From 003620d3104b32d3fb34ae967e8037748fd661c8 Mon Sep 17 00:00:00 2001 From: Sam Tannous Date: Tue, 8 Jul 2014 15:15:46 -0400 Subject: [PATCH] Add ignore handler for SIGHUP in lldpcli lldpcli which is execed by lldpd is expected to resume lldpd operations. But in some cases, lldpcli can exiting because of SIGHUP. This fixes these cases. Signed-off-by: Roopa Prabhu Signed-off-by: Kanna Rajagopal Signed-off-by: Sam Tannous --- src/client/lldpcli.c | 3 +++ src/daemon/lldpd.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/client/lldpcli.c b/src/client/lldpcli.c index 5e0d027e..47375918 100644 --- a/src/client/lldpcli.c +++ b/src/client/lldpcli.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include "client.h" @@ -426,6 +427,8 @@ main(int argc, char *argv[]) ctlname = lldpctl_get_default_transport(); + signal(SIGHUP, SIG_IGN); + /* Initialize logging */ while ((ch = getopt(argc, argv, options)) != -1) { switch (ch) { diff --git a/src/daemon/lldpd.c b/src/daemon/lldpd.c index d9575b96..05e323a4 100644 --- a/src/daemon/lldpd.c +++ b/src/daemon/lldpd.c @@ -1471,6 +1471,9 @@ lldpd_main(int argc, char *argv[], char *envp[]) /* Disable SIGPIPE */ signal(SIGPIPE, SIG_IGN); + /* Disable SIGHUP, until handlers are installed */ + signal(SIGHUP, SIG_IGN); + /* Configuration with lldpcli */ if (lldpcli) { log_debug("main", "invoking lldpcli for configuration"); -- 2.39.5