This patch moves the creation of the PID file until after syslogd has
set up signal handlers and is ready.

Signed-off-by: Joachim Nilsson <[email protected]>
---
 sysklogd/syslogd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index ab50f4a28..84e6fa5e6 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -1035,6 +1035,7 @@ static void do_syslogd(void)
                kmsg_init();
 
        timestamp_and_log_internal("syslogd started: BusyBox v" BB_VER);
+       write_pidfile_std_path_and_ext("syslogd");
 
        while (!bb_got_signal) {
                ssize_t sz;
@@ -1183,9 +1184,6 @@ int syslogd_main(int argc UNUSED_PARAM, char **argv)
                bb_daemonize_or_rexec(DAEMON_CHDIR_ROOT, argv);
        }
 
-       //umask(0); - why??
-       write_pidfile_std_path_and_ext("syslogd");
-
        do_syslogd();
        /* return EXIT_SUCCESS; */
 }
-- 
2.25.1

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to