Skip to contentSkip to conversation

cluster/ccs/daemon ccsd.c

Cluster-devel [email protected] 1 participant 1 message Aug 31, 2006

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Changes by: rohara at sourceware.org 2006-08-31 17:49:16

Modified files:
ccs/daemon : ccsd.c

Log message:
Moved code which signals parent (SIGTERM), which allows the parent process to continue and exit. This signal was occuring before ccsd had the sockets ready for communication, and as a result the cman init script would sometimes fail because the ccsd would daemonize before the socket was ready.

This fix will not signal the parent until ccsd is ready (socket is created and ready; before select() loop).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/ccs/daemon/ccsd.c.diff?cvsroot=cluster&r1=1.25&r2=1.26

ccs/daemon/ccsd.c +4 -1
@@ -181,6 +181,9 @@
   if (sfds[2] >= 0) 
     FD_SET(sfds[2], &rset);
 
+  log_dbg("Sending SIGTERM to parent\n");
+  kill(getppid(), SIGTERM);
+
   while(1){
     unsigned int len = addr_size;
 
@@ -755,7 +758,7 @@
     }
 
     /* Make the parent stop waiting */
-    kill(getppid(), SIGTERM);
+    /* kill(getppid(), SIGTERM); */
   }
 
   signal(SIGINT, &sig_handler);