cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH] Cman: Handle INT and TERM signals correctly
@ 2011-01-06 10:38 Fabio M. Di Nitto
  2011-01-06 10:42 ` Fabio M. Di Nitto
  0 siblings, 1 reply; 2+ messages in thread
From: Fabio M. Di Nitto @ 2011-01-06 10:38 UTC (permalink / raw)
  To: cluster-devel.redhat.com

From: Jan Friesse <jfriesse@redhat.com>

Corosync signal handler (SIGINT and SIGTERM) is replaced by cman one,
and this was settting quit_threads to 1. Regular cman shutdown sequence
(cman_tool leave) tests if quit_threads is set or not. If so, it refuses
continue so it was not possible to cleanly leave cluster.

Now SIGINT and SIGTERM are ignored, and (un)intentional kill of corosync
is no longer problem.

Resolves: rhbz#617234
---
 cman/daemon/daemon.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/cman/daemon/daemon.c b/cman/daemon/daemon.c
index 64607cc..92cfd47 100644
--- a/cman/daemon/daemon.c
+++ b/cman/daemon/daemon.c
@@ -489,11 +489,6 @@ int num_listeners(void)
 	return count;
 }
 
-static void sigint_handler(int ignored)
-{
-	quit_threads = 1;
-}
-
 int cman_init(struct corosync_api_v1 *api)
 {
 	int fd;
@@ -514,12 +509,10 @@ int cman_init(struct corosync_api_v1 *api)
 		return -2;
 
 	/* Shutdown trap */
-	sa.sa_handler = sigint_handler;
-	sigaction(SIGINT, &sa, NULL);
-	sigaction(SIGTERM, &sa, NULL);
-
 	sa.sa_handler = SIG_IGN;
 	sigaction(SIGPIPE, &sa, NULL);
+	sigaction(SIGINT, &sa, NULL);
+	sigaction(SIGTERM, &sa, NULL);
 
 	return 0;
 }
-- 
1.7.2.3



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-06 10:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-06 10:38 [Cluster-devel] [PATCH] Cman: Handle INT and TERM signals correctly Fabio M. Di Nitto
2011-01-06 10:42 ` Fabio M. Di Nitto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).