Keep logit alive until stdin is closed

By not putting logit in the same process group as the service whose
output is consumed by logit, we can send signals to the service,
and it's group, without affecting logit. This means that logit will
continue to log away until it's stdin is closed, which will happen
when the service is reaped.

Signed-off-by: Jacques de Laval <jacques@de-laval.se>
This commit is contained in:
Jacques de Laval
2021-02-17 00:00:50 +01:00
parent 703ae0caf3
commit 06aea7d3f3
+3 -3
View File
@@ -371,6 +371,9 @@ static int service_start(svc_t *svc)
}
args[i] = NULL;
redirect(svc);
sig_unblock();
/*
* The setsid() call is the most humble of all in this
* function. It takes care to detach the process from
@@ -385,9 +388,6 @@ static int service_start(svc_t *svc)
*/
setsid();
redirect(svc);
sig_unblock();
if (svc_is_runtask(svc))
status = exec_runtask(svc->cmd, args);
else