cluster: RHEL6 - cpglockd: refuse to shutdown if clients are connected
Ryan McCabe
rmccabe at fedoraproject.org
Tue May 1 15:01:42 UTC 2012
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=07b7db55437342aab9d51852121d96e4bff2b6c1
Commit: 07b7db55437342aab9d51852121d96e4bff2b6c1
Parent: 7f97877bb418014bfe9bc3fb6fff554ad98c22aa
Author: Fabio M. Di Nitto <fdinitto at redhat.com>
AuthorDate: Tue Apr 24 15:58:31 2012 +0200
Committer: Ryan McCabe <rmccabe at redhat.com>
CommitterDate: Tue May 1 10:58:51 2012 -0400
cpglockd: refuse to shutdown if clients are connected
or bad things will happen
Signed-off-by: Fabio M. Di Nitto <fdinitto at redhat.com>
Reviewed-by: Lon Hohberger <lhh at redhat.com>
Reviewed-by: Ryan McCabe <rmccabe at redhat.com>
---
rgmanager/src/daemons/cpglockd.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/rgmanager/src/daemons/cpglockd.c b/rgmanager/src/daemons/cpglockd.c
index 47cbcdc..7e1ae33 100644
--- a/rgmanager/src/daemons/cpglockd.c
+++ b/rgmanager/src/daemons/cpglockd.c
@@ -89,6 +89,10 @@ static void init_logging(int reconf);
static void
flag_shutdown(int __attribute__ ((unused)) sig)
{
+ if (clients) {
+ logt_print(LOG_INFO, "Clients are connected to cpglockd. Refusing to shutdown\n");
+ return;
+ }
shutdown_pending = 1;
}
@@ -1429,6 +1433,7 @@ main(int argc, char **argv)
setup_signal(SIGPIPE, SIG_IGN);
setup_signal(SIGTERM, flag_shutdown);
+ setup_signal(SIGINT, flag_shutdown);
cman_connect(&cman_handle);
if (cman_handle == NULL) {
More information about the cluster-commits
mailing list