summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-03-25 21:28:13 -0300
committerRenato Westphal <renato@opensourcerouting.org>2017-03-27 14:54:57 -0300
commit1e7e440f5a5555b286e9b6265e9e481d11123fcd (patch)
tree496ca09cbecb0b7997b93c755a3951ab7b6280a7
parent56b8a8d231bf36a7011eb97eb115a148b3395635 (diff)
ldpd: ignore the SIGHUP signal in the child processes
Only the parent process should handle the SIGHUP signal, but we need to make sure that this signal is ignored in the child processes so a command like "killall -SIGHUP ldpd" won't kill ldpd. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
-rw-r--r--ldpd/lde.c4
-rw-r--r--ldpd/ldpe.c4
-rw-r--r--lib/sigevent.c3
3 files changed, 10 insertions, 1 deletions
diff --git a/ldpd/lde.c b/ldpd/lde.c
index 3247c8c1cc..e927e45367 100644
--- a/ldpd/lde.c
+++ b/ldpd/lde.c
@@ -106,6 +106,10 @@ sigint(void)
static struct quagga_signal_t lde_signals[] =
{
{
+ .signal = SIGHUP,
+ /* ignore */
+ },
+ {
.signal = SIGINT,
.handler = &sigint,
},
diff --git a/ldpd/ldpe.c b/ldpd/ldpe.c
index 6c542c5e34..ada732d6fc 100644
--- a/ldpd/ldpe.c
+++ b/ldpd/ldpe.c
@@ -88,6 +88,10 @@ sigint(void)
static struct quagga_signal_t ldpe_signals[] =
{
{
+ .signal = SIGHUP,
+ /* ignore */
+ },
+ {
.signal = SIGINT,
.handler = &sigint,
},
diff --git a/lib/sigevent.c b/lib/sigevent.c
index a120028d81..09f07180ce 100644
--- a/lib/sigevent.c
+++ b/lib/sigevent.c
@@ -108,7 +108,8 @@ quagga_sigevent_process (void)
if (sig->caught > 0)
{
sig->caught = 0;
- sig->handler ();
+ if (sig->handler)
+ sig->handler ();
}
}
}