From c146b966913ae80652e3be925d3aba60ed82f14d Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Fri, 16 Sep 2016 14:23:09 -0500 Subject: Add command_progress variable If this is set to yes, 1, true, or on, start-stop-daemon will display a progress meter while waiting for a daemon to stop. --- man/openrc-run.8 | 4 ++++ sh/start-stop-daemon.sh | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/man/openrc-run.8 b/man/openrc-run.8 index 6e3b9dc7..5ec81567 100644 --- a/man/openrc-run.8 +++ b/man/openrc-run.8 @@ -143,6 +143,10 @@ Set this to "true", "yes" or "1" (case-insensitive) if you want .Xr start-stop-daemon 8 to force the daemon into the background. This forces the "--make-pidfile" and "--pidfile" options, so the pidfile variable must be set. +.It Ar command_progress +Set this to "true", "yes" or "1" (case-insensitive) if you want +.Xr start-stop-daemon 8 +to display a progress meter when waiting for a daemon to stop. .It Ar command_user If the daemon does not support changing to a different user id, you can use this to change the user id before diff --git a/sh/start-stop-daemon.sh b/sh/start-stop-daemon.sh index 6b679ac2..6f396b3b 100644 --- a/sh/start-stop-daemon.sh +++ b/sh/start-stop-daemon.sh @@ -63,6 +63,7 @@ ssd_start() ssd_stop() { + local _progress= local startcommand="$(service_get_value "command")" local startchroot="$(service_get_value "chroot")" local startpidfile="$(service_get_value "pidfile")" @@ -72,13 +73,15 @@ ssd_stop() pidfile="${startpidfile:-$pidfile}" procname="${startprocname:-$procname}" [ -n "$command" -o -n "$procname" -o -n "$pidfile" ] || return 0 + yesno "${command_progress}" && _progress=--progress ebegin "Stopping ${name:-$RC_SVCNAME}" start-stop-daemon --stop \ ${retry:+--retry} $retry \ ${command:+--exec} $command \ ${procname:+--name} $procname \ ${pidfile:+--pidfile} $chroot$pidfile \ - ${stopsig:+--signal} $stopsig + ${stopsig:+--signal} $stopsig \ + ${_progress} eend $? "Failed to stop ${name:-$RC_SVCNAME}" } -- cgit v1.2.3