Bläddra i källkod

Merge trunk revision 2520:
r2520 | beekhof | 2009-10-12 23:16:14 -0700 (Mon, 12 Oct 2009) | 1 line

Add SIGTERM support and have the init script wait for corosync to actually terminate. Bud rh#525552



git-svn-id: http://svn.fedorahosted.org/svn/corosync/branches/flatiron@2526 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake 16 år sedan
förälder
incheckning
d95cd00c5a
2 ändrade filer med 17 tillägg och 4 borttagningar
  1. 1 0
      exec/main.c
  2. 16 4
      init/redhat

+ 1 - 0
exec/main.c

@@ -820,6 +820,7 @@ int main (int argc, char **argv)
 	(void)signal (SIGSEGV, sigsegv_handler);
 	(void)signal (SIGABRT, sigabrt_handler);
 	(void)signal (SIGQUIT, sigquit_handler);
+	(void)signal (SIGTERM, sigquit_handler);
 #if MSG_NOSIGNAL != 0
 	(void)signal (SIGPIPE, SIG_IGN);
 #endif

+ 16 - 4
init/redhat

@@ -27,11 +27,23 @@ start() {
 
 stop() {
     echo -n $"Stopping Corosync Cluster Engine ($prog): "
-    killproc $prog
-    retval=$?
-    [ "$retval" -eq 0 ] && rm -f "$lockfile"
+    # If no signal is specified, -TERM is used but _also_ -KILL 3s later
+    # This is far too aggressive for a cluster resource manager running on top of Corosync
+    killproc $prog -TERM
     echo
-    return $retval
+
+    echo -n $"Waiting for services to unload:"
+    while
+        pidofproc $prog > /dev/null 2>&1
+    do
+        sleep 2
+    done
+
+    success $"$base shutdown"
+    echo
+
+    rm -f "$lockfile"
+    return 0
 }
 
 restart() {