]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
set close on exec on pipe in event scripts, so long running scripts don't hold the...
authorAndrew Tridgell <tridge@samba.org>
Tue, 5 Jun 2007 05:18:37 +0000 (15:18 +1000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 5 Jun 2007 05:18:37 +0000 (15:18 +1000)
(This used to be ctdb commit 22662614b4091a4e4282e63d6876097cbf3e3d6e)

ctdb/config/ctdb.sysconfig
ctdb/config/events.d/50.samba
ctdb/config/events.d/59.nfslock
ctdb/config/events.d/60.nfs
ctdb/takeover/system.c

index 3e569961bbb49baacf180a06f550bd63cfbeb935..2ee0b8581c0356c73d4aab91ac2cc4af7c181125 100644 (file)
 # 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
index f17f7eac9867aa26b60f51fdd14b6c04c2a658b7..0deea3f182ae7ccbccca60eecf274b199f15170b 100755 (executable)
@@ -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
index b030ab5463d9186a3b03ac779d9b5aed44856cd8..187d35ba41eb612f9c470268824126d6d77f72bd 100755 (executable)
@@ -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
        ;;
 
index 23fdb088826e2d82a7634ed7a4380338b0cd26e4..258a2309d0cebb66c6ba74253eea08c4e4b441df 100755 (executable)
@@ -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
        ;;
 
index 60f551b7b5610941ee67cd9df343e829f3284577..5d5bd7223f4bb998ee4860a30708a65f802503e9 100644 (file)
@@ -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);