Skip to content

Commit

Permalink
start-stop-daemon: open syslog
Browse files Browse the repository at this point in the history
The stop schedule code calls syslog, so we need to open a syslog
connection so the process name will get properly logged on musl, and we
can ensure the pid gets logged and the right facility is used.
  • Loading branch information
dwfreed authored and williamh committed Jul 22, 2024
1 parent 53071ce commit 3277e65
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/start-stop-daemon/start-stop-daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
#include <sys/ioctl.h>
#include <sys/resource.h>
#include <sys/stat.h>
Expand Down Expand Up @@ -359,6 +360,8 @@ int main(int argc, char **argv)
signal_setup(SIGQUIT, handle_signal);
signal_setup(SIGTERM, handle_signal);

openlog(applet, LOG_PID, LOG_DAEMON);

if ((tmp = getenv("SSD_NICELEVEL")))
if (sscanf(tmp, "%d", &nicelevel) != 1)
eerror("%s: invalid nice level `%s' (SSD_NICELEVEL)",
Expand Down

0 comments on commit 3277e65

Please sign in to comment.