From 31594635ecc132720e72bd807f7090248620a750 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Wed, 1 Jan 2014 14:00:33 +0100 Subject: [PATCH] daemon: unset UPSTART_JOB and NOTIFY_SOCKET once used While we shouldn't have children that use those environment variables, better safe than sorry. --- src/daemon/lldpd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/daemon/lldpd.c b/src/daemon/lldpd.c index f3cc7fe1..59c0cee1 100644 --- a/src/daemon/lldpd.c +++ b/src/daemon/lldpd.c @@ -1196,6 +1196,7 @@ lldpd_started_by_upstart() return 0; log_debug("main", "running with upstart, don't fork but stop"); raise(SIGSTOP); + unsetenv("UPSTART_JOB"); return 1; #else return 0; @@ -1237,6 +1238,7 @@ lldpd_started_by_systemd() .msg_iov = &iov, .msg_iovlen = 1 }; + unsetenv("NOTIFY_SOCKET"); if (sendmsg(fd, &hdr, MSG_NOSIGNAL) < 0) { log_warn("main", "unable to send notification to systemd"); close(fd); -- 2.39.5