From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-901647-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 9A03E138330
	for <garchives@archives.gentoo.org>; Fri, 16 Sep 2016 19:27:20 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id C04A7E0BB1;
	Fri, 16 Sep 2016 19:27:19 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id D1782E0BB1
	for <gentoo-commits@lists.gentoo.org>; Fri, 16 Sep 2016 19:27:18 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 0CB5C340BE8
	for <gentoo-commits@lists.gentoo.org>; Fri, 16 Sep 2016 19:27:18 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id A71D22481
	for <gentoo-commits@lists.gentoo.org>; Fri, 16 Sep 2016 19:27:16 +0000 (UTC)
From: "William Hubbs" <williamh@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" <williamh@gentoo.org>
Message-ID: <1474053789.c146b966913ae80652e3be925d3aba60ed82f14d.williamh@OpenRC>
Subject: [gentoo-commits] proj/openrc:master commit in: man/, sh/
X-VCS-Repository: proj/openrc
X-VCS-Files: man/openrc-run.8 sh/start-stop-daemon.sh
X-VCS-Directories: man/ sh/
X-VCS-Committer: williamh
X-VCS-Committer-Name: William Hubbs
X-VCS-Revision: c146b966913ae80652e3be925d3aba60ed82f14d
X-VCS-Branch: master
Date: Fri, 16 Sep 2016 19:27:16 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 51952851-3dbf-4eaa-895d-cfb9c0b4dbda
X-Archives-Hash: 05795abb080fae5b42dcb21179ad4414

commit:     c146b966913ae80652e3be925d3aba60ed82f14d
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Fri Sep 16 19:23:09 2016 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Fri Sep 16 19:23:09 2016 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=c146b966

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 6e3b9dc..5ec8156 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 6b679ac..6f396b3 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}"
 }