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 <[email protected]>
---
 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
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to