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.
This commit is contained in:
		| @@ -143,6 +143,10 @@ Set this to "true", "yes" or "1" (case-insensitive) if you want | |||||||
| .Xr start-stop-daemon 8 | .Xr start-stop-daemon 8 | ||||||
| to force the daemon into the background. This forces the | to force the daemon into the background. This forces the | ||||||
| "--make-pidfile" and "--pidfile" options, so the pidfile variable must be set. | "--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 | .It Ar command_user | ||||||
| If the daemon does not support changing to a different user id, you can | If the daemon does not support changing to a different user id, you can | ||||||
| use this to change the user id before | use this to change the user id before | ||||||
|   | |||||||
| @@ -63,6 +63,7 @@ ssd_start() | |||||||
|  |  | ||||||
| ssd_stop() | ssd_stop() | ||||||
| { | { | ||||||
|  | 	local _progress= | ||||||
| 	local startcommand="$(service_get_value "command")" | 	local startcommand="$(service_get_value "command")" | ||||||
| 	local startchroot="$(service_get_value "chroot")" | 	local startchroot="$(service_get_value "chroot")" | ||||||
| 	local startpidfile="$(service_get_value "pidfile")" | 	local startpidfile="$(service_get_value "pidfile")" | ||||||
| @@ -72,13 +73,15 @@ ssd_stop() | |||||||
| 	pidfile="${startpidfile:-$pidfile}" | 	pidfile="${startpidfile:-$pidfile}" | ||||||
| 	procname="${startprocname:-$procname}" | 	procname="${startprocname:-$procname}" | ||||||
| 	[ -n "$command" -o -n "$procname" -o -n "$pidfile" ] || return 0 | 	[ -n "$command" -o -n "$procname" -o -n "$pidfile" ] || return 0 | ||||||
|  | 	yesno "${command_progress}" && _progress=--progress | ||||||
| 	ebegin "Stopping ${name:-$RC_SVCNAME}" | 	ebegin "Stopping ${name:-$RC_SVCNAME}" | ||||||
| 	start-stop-daemon --stop \ | 	start-stop-daemon --stop \ | ||||||
| 		${retry:+--retry} $retry \ | 		${retry:+--retry} $retry \ | ||||||
| 		${command:+--exec} $command \ | 		${command:+--exec} $command \ | ||||||
| 		${procname:+--name} $procname \ | 		${procname:+--name} $procname \ | ||||||
| 		${pidfile:+--pidfile} $chroot$pidfile \ | 		${pidfile:+--pidfile} $chroot$pidfile \ | ||||||
| 		${stopsig:+--signal} $stopsig | 		${stopsig:+--signal} $stopsig \ | ||||||
|  | 		${_progress} | ||||||
|  |  | ||||||
| 	eend $? "Failed to stop ${name:-$RC_SVCNAME}" | 	eend $? "Failed to stop ${name:-$RC_SVCNAME}" | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user