From cd91e2c66cab55f826f49b415779649a185f5686 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sat, 29 Sep 2018 15:16:59 +0200 Subject: [PATCH] Skip "Restarting ... " progress for bootstrap processes Reduce the noise: we don't need to notify the user if a process started in bootstrap is simply SIGHUPed. Signed-off-by: Joachim Nilsson --- src/service.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/service.c b/src/service.c index 2fdb1ce5..77ec57be 100644 --- a/src/service.c +++ b/src/service.c @@ -464,6 +464,7 @@ static int service_stop(svc_t *svc) */ static int service_restart(svc_t *svc) { + int do_progress = 1; int rc; /* Ignore if finit is SIGSTOP'ed */ @@ -479,10 +480,14 @@ static int service_restart(svc_t *svc) return 1; } - _d("Sending SIGHUP to PID %d", svc->pid); - if (svc->desc[0]) + /* Skip progress if desc disabled or bootstrap task */ + if (!svc->desc[0] || svc_in_runlevel(svc, 0)) + do_progress = 0; + + if (do_progress) print_desc("Restarting ", svc->desc); + _d("Sending SIGHUP to PID %d", svc->pid); rc = kill(svc->pid, SIGHUP); /* Declare we're waiting for svc to re-assert/touch its pidfile */ @@ -494,7 +499,7 @@ static int service_restart(svc_t *svc) touch(pid_file(svc)); } - if (svc->desc[0]) + if (do_progress) print_result(rc); return rc;