Allow setting custom pid: file for SysV init scripts

We want to find the PID of the daemon the init script starts, so we need
a way to declare this to Finit.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2022-03-25 06:52:03 +01:00
parent 093b3ba467
commit 07f7caef0d
+1 -1
View File
@@ -1326,7 +1326,7 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file)
}
/* Decode any optional pid:/optional/path/to/file.pid */
if (pid && svc_is_daemon(svc) && pid_file_parse(svc, pid))
if (pid && (svc_is_daemon(svc) || svc_is_sysv(svc)) && pid_file_parse(svc, pid))
_e("Invalid 'pid' argument to service: %s", pid);
if (username) {