mirror of
https://github.com/troglobit/finit.git
synced 2026-10-04 14:54:14 +07:00
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:
+3
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user