mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
set close on exec on pipe in event scripts, so long running scripts don't hold the pipe
(This used to be ctdb commit 22662614b4091a4e4282e63d6876097cbf3e3d6e)
This commit is contained in:
parent
a3048a8942
commit
ee747b5bd6
@ -20,6 +20,11 @@
|
||||
# default is to not manage Samba
|
||||
# CTDB_MANAGES_SAMBA=yes
|
||||
|
||||
# you may wish to raise the file descriptor limit for ctdb
|
||||
# use a ulimit command here. ctdb needs one file descriptor per
|
||||
# connected client (ie. one per connected client in Samba)
|
||||
# ulimit -n 10000
|
||||
|
||||
# the NODES file must be specified or ctdb won't start
|
||||
# it should contain a list of IPs that ctdb will use
|
||||
# it must be exactly the same on all cluster nodes
|
||||
|
@ -17,6 +17,10 @@ case $cmd in
|
||||
smb_dirs=`testparm -st 2> /dev/null | egrep '^\s*path = ' | cut -d= -f2`
|
||||
ctdb_wait_directories "Samba" $smb_dirs
|
||||
|
||||
# make sure samba is not already started
|
||||
service smb stop > /dev/null 2>&1
|
||||
service winbind stop > /dev/null 2>&1
|
||||
|
||||
# start Samba service
|
||||
service smb start
|
||||
service winbind start
|
||||
|
@ -16,6 +16,8 @@ case $cmd in
|
||||
/bin/mkdir -p /etc/ctdb/state/statd/ip
|
||||
ctdb_wait_directories "nfslock" "$STATD_SHARED_DIRECTORY"
|
||||
|
||||
# make sure the service is stopped first
|
||||
service nfslock stop > /dev/null 2>&1
|
||||
service nfslock start
|
||||
;;
|
||||
|
||||
|
@ -17,6 +17,8 @@ case $cmd in
|
||||
nfs_dirs=`grep -v '^#' < /etc/exports | cut -d' ' -f1`
|
||||
ctdb_wait_directories "NFS" $nfs_dirs
|
||||
|
||||
# make sure nfs is stopped before we start it, or it may get a bind error
|
||||
service nfs stop > /dev/null 2>&1
|
||||
service nfs start
|
||||
;;
|
||||
|
||||
|
@ -386,6 +386,7 @@ int ctdb_event_script_callback(struct ctdb_context *ctdb,
|
||||
if (state->child == 0) {
|
||||
close(state->fd[0]);
|
||||
ctdb_set_realtime(false);
|
||||
set_close_on_exec(state->fd[1]);
|
||||
va_start(ap, fmt);
|
||||
ret = ctdb_event_script_v(ctdb, fmt, ap);
|
||||
va_end(ap);
|
||||
|
Loading…
x
Reference in New Issue
Block a user