Cman: Handle INT and TERM signals correctly
PATCH 1/1 Cman: Handle INT and TERM signals correctly
From: Jan Friesse <[email protected]>
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(-)
cman/daemon/daemon.c +2 -9
@@ -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 ; }
Signature · 1 line
1.7.2.3
PATCH 1/1 Cman: Handle INT and TERM signals correctly
Re-iterating the patch for ACK to go in RHEL6.
Fabio
Quoted 46 lines · Fabio M. Di Nitto
From: Jan Friesse <[email protected]>
Corosync signal handler (SIGINT and SIGTERM) is replaced by cman one, and this was settting
quit_threadsto 1. Regular cman shutdown sequence (cman_toolleave) tests ifquit_threadsis 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(-)cman/daemon/daemon.c +2
-9@@ -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 ; }