[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [PATCH] syslogd: unlink _PATH_LOG when exiting if not in systemd
From:       Chen Qi <Qi.Chen () windriver ! com>
Date:       2014-09-29 8:02:27
Message-ID: 1411977747-32101-1-git-send-email-Qi.Chen () windriver ! com
[Download RAW message or body]

If the /dev/log is created by syslogd daemon, then we need to unlink
it when the daemon exists.

If /dev/log is created by systemd, then systemd is responsible for
it, hence there's no need to unlink it in syslogd.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 sysklogd/syslogd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 266657f..fb35cc7 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -998,6 +998,8 @@ static void do_syslogd(void)
 	ipcsyslog_cleanup();
 	if (option_mask32 & OPT_kmsg)
 		kmsg_cleanup();
+	if (!(sd_listen_fds() == 1))
+		unlink(_PATH_LOG);
 	kill_myself_with_sig(bb_got_signal);
 #undef recvbuf
 }
-- 
1.9.1

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic