cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Jacek Konieczny <jajcus@jajcus.net>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 3/3] Do not crash uncleanly on SIGINT and SIGHUP
Date: Fri,  2 Nov 2012 16:39:50 +0100	[thread overview]
Message-ID: <1351870790-22294-4-git-send-email-jajcus@jajcus.net> (raw)
In-Reply-To: <1351870790-22294-1-git-send-email-jajcus@jajcus.net>

Unclean shut-down of dlm_controld may trigger a node fencing,
this should not be triggered by mistake.

SIGINT is the natural way to stop dlm_controld started on a terminal
with '-D' for debugging ? let this work like SIGTERM.

SIGHUP is often used for config reload. dlm_controld doesn't support
that, but when someone tries this by mistake, this is not a reason to
crash.

Signed-off-by: Jacek Konieczny <jajcus@jajcus.net>
---
 dlm_controld/main.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/dlm_controld/main.c b/dlm_controld/main.c
index 6eafa49..fd469f9 100644
--- a/dlm_controld/main.c
+++ b/dlm_controld/main.c
@@ -1582,6 +1582,15 @@ int main(int argc, char **argv)
 	rv = sigaction(SIGTERM, &act, NULL);
 	if (rv < 0)
 		return -rv;
+	rv = sigaction(SIGINT, &act, NULL);
+	if (rv < 0)
+		return -rv;
+
+	memset(&act, 0, sizeof(act));
+	act.sa_handler = SIG_IGN;
+	rv = sigaction(SIGHUP, &act, NULL);
+	if (rv < 0)
+		return -rv;
 
 	memset(&act, 0, sizeof(act));
 	act.sa_handler = sigchld_handler;
-- 
1.7.12.4



      parent reply	other threads:[~2012-11-02 15:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-02 15:39 [Cluster-devel] DLM patches from PLD Linux Jacek Konieczny
2012-11-02 15:39 ` [Cluster-devel] [PATCH 1/3] Fix linking order Jacek Konieczny
2012-11-02 15:39 ` [Cluster-devel] [PATCH 2/3] Run dlm.service after sys-kernel-config.mount Jacek Konieczny
2012-11-02 15:39 ` Jacek Konieczny [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1351870790-22294-4-git-send-email-jajcus@jajcus.net \
    --to=jajcus@jajcus.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).