aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Nilsson <troglobit@gmail.com>2020-05-09 16:49:24 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2020-11-16 12:12:04 +0100
commitefe99b59c6cd3d9de91ebfc39f9870b8708e5b92 (patch)
tree89612fc57f5035b7874c0e20240a85db3483cb6e
parenta4747230abfca9c5b5345d9e34574b4f3192be6a (diff)
downloadbusybox-w32-efe99b59c6cd3d9de91ebfc39f9870b8708e5b92.tar.gz
busybox-w32-efe99b59c6cd3d9de91ebfc39f9870b8708e5b92.tar.bz2
busybox-w32-efe99b59c6cd3d9de91ebfc39f9870b8708e5b92.zip
syslogd: delay PID file creation until syslogd is ready
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 <troglobit@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--sysklogd/syslogd.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index f61da9de5..598f28d0c 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -1034,6 +1034,7 @@ static void do_syslogd(void)
1034 kmsg_init(); 1034 kmsg_init();
1035 1035
1036 timestamp_and_log_internal("syslogd started: BusyBox v" BB_VER); 1036 timestamp_and_log_internal("syslogd started: BusyBox v" BB_VER);
1037 write_pidfile_std_path_and_ext("syslogd");
1037 1038
1038 while (!bb_got_signal) { 1039 while (!bb_got_signal) {
1039 ssize_t sz; 1040 ssize_t sz;
@@ -1182,9 +1183,6 @@ int syslogd_main(int argc UNUSED_PARAM, char **argv)
1182 bb_daemonize_or_rexec(DAEMON_CHDIR_ROOT, argv); 1183 bb_daemonize_or_rexec(DAEMON_CHDIR_ROOT, argv);
1183 } 1184 }
1184 1185
1185 //umask(0); - why??
1186 write_pidfile_std_path_and_ext("syslogd");
1187
1188 do_syslogd(); 1186 do_syslogd();
1189 /* return EXIT_SUCCESS; */ 1187 /* return EXIT_SUCCESS; */
1190} 1188}