]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
Add ignore handler for SIGHUP in lldpcli
authorSam Tannous <stannous@cumulusnetworks.com>
Tue, 8 Jul 2014 19:15:46 +0000 (15:15 -0400)
committerVincent Bernat <vincent@bernat.im>
Tue, 8 Jul 2014 20:37:48 +0000 (22:37 +0200)
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 <roopa@cumulusnetworks.com>
Signed-off-by: Kanna Rajagopal <kanna@cumulusnetworks.com>
Signed-off-by: Sam Tannous <stannous@cumulusnetworks.com>
src/client/lldpcli.c
src/daemon/lldpd.c

index 5e0d027e666a0acccfbb87554e21370746faffd0..4737591811d2b51c836685ec8ff95d2d57f10cfb 100644 (file)
@@ -29,6 +29,7 @@
 #include <arpa/inet.h>
 #include <libgen.h>
 #include <dirent.h>
+#include <signal.h>
 #include <sys/queue.h>
 
 #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) {
index d9575b961f5f96b2104161705ef4c341106b8105..05e323a4c0ba328cc869082d926349b82dc6d35a 100644 (file)
@@ -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");