Issue #223: add type:forking service option, with updated docs

- Add `type:forking` service option to trigger guessing pidfile to
   watch for, instead of `pid:!foo` option, which is not intuitive.
   This option may likely also survive into the new file format :)
 - Update docs and add examples
 - Update start-stop-serv.sh test case with this new variant

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2022-04-04 19:13:28 +02:00
1 parent 462d5b22b4
commit c926160853
7 files changed
+74 -12

No files matched your search

+5
View File
@@ -158,6 +158,11 @@ int pid_file_set(svc_t *svc, char *file, int not)
file++;
}
if (svc_is_forking(svc) && !not) {
logit(LOG_WARNING, "Service %s is forking, adjusting to pid:!%s", svc->name, file);
not = 1;
}
pid_runpath(file, &svc->pidfile[not], sizeof(svc->pidfile) - not);
if (not)
svc->pidfile[0] = '!';