mirror of
https://github.com/troglobit/finit.git
synced 2026-11-13 17:00:16 +00:00
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 <troglobit@gmail.com>
This commit is contained in:
1 parent
470549badb
commit
cd91e2c66c
1 file changed
+8
-3
+8
-3
@@ -464,6 +464,7 @@ static int service_stop(svc_t *svc)
|
|||||||
*/
|
*/
|
||||||
static int service_restart(svc_t *svc)
|
static int service_restart(svc_t *svc)
|
||||||
{
|
{
|
||||||
|
int do_progress = 1;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
/* Ignore if finit is SIGSTOP'ed */
|
/* Ignore if finit is SIGSTOP'ed */
|
||||||
@@ -479,10 +480,14 @@ static int service_restart(svc_t *svc)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
_d("Sending SIGHUP to PID %d", svc->pid);
|
/* Skip progress if desc disabled or bootstrap task */
|
||||||
if (svc->desc[0])
|
if (!svc->desc[0] || svc_in_runlevel(svc, 0))
|
||||||
|
do_progress = 0;
|
||||||
|
|
||||||
|
if (do_progress)
|
||||||
print_desc("Restarting ", svc->desc);
|
print_desc("Restarting ", svc->desc);
|
||||||
|
|
||||||
|
_d("Sending SIGHUP to PID %d", svc->pid);
|
||||||
rc = kill(svc->pid, SIGHUP);
|
rc = kill(svc->pid, SIGHUP);
|
||||||
|
|
||||||
/* Declare we're waiting for svc to re-assert/touch its pidfile */
|
/* 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));
|
touch(pid_file(svc));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (svc->desc[0])
|
if (do_progress)
|
||||||
print_result(rc);
|
print_result(rc);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
|||||||
Reference in new issue
Block a user