diff options
author | Doug Freed <dwfreed@mtu.edu> | 2024-06-25 18:03:30 +0000 |
---|---|---|
committer | Anna (navi) Figueiredo Gomes <navi@vlhl.dev> | 2024-07-20 15:26:24 +0200 |
commit | e46a16383517cf7a75a9b55f293e677be027a972 (patch) | |
tree | 1839292d328f7ceb979f59d9ebfaeddfe2d132a5 | |
parent | 15de84d70ccd57afd7ad5af5cf95cef7fc542141 (diff) | |
download | openrc-e46a16383517cf7a75a9b55f293e677be027a972.tar.xz |
start-stop-daemon: open syslog
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.
-rw-r--r-- | src/start-stop-daemon/start-stop-daemon.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/start-stop-daemon/start-stop-daemon.c b/src/start-stop-daemon/start-stop-daemon.c index 3e4a19a1..dda89a64 100644 --- a/src/start-stop-daemon/start-stop-daemon.c +++ b/src/start-stop-daemon/start-stop-daemon.c @@ -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> @@ -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)", |