Patchwork [v2,1/3] sysvinit: bootlogd: Honor VERBOSE

login
register
mail settings
Submitter Ben Shelton
Date July 22, 2014, 8:23 p.m.
Message ID <1406060616-15914-1-git-send-email-ben.shelton@ni.com>
Download mbox | patch
Permalink /patch/76427/
State Accepted
Commit 48641d57d478c682398e6135c659be93fafd9f0b
Headers show

Comments

Ben Shelton - July 22, 2014, 8:23 p.m.
From: Richard Tollerton <rich.tollerton@ni.com>

The messages echoed when starting and stopping bootlogd are currently
printed regardless of the setting of VERBOSE.  Adjust the initscript so
they're only printed when VERBOSE is enabled.

Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
Signed-off-by: Ben Shelton <ben.shelton@ni.com>
---
 meta/recipes-core/sysvinit/sysvinit/bootlogd.init | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Patch

diff --git a/meta/recipes-core/sysvinit/sysvinit/bootlogd.init b/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
index 7d6518d..06af465 100755
--- a/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
+++ b/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
@@ -46,7 +46,7 @@  esac
 
 case "$ACTION" in
 	start)
-		echo -n "Starting $DESC: "
+		[ "${VERBOSE}" != "no" ] && echo -n "Starting $DESC: "
 		if [ -d /proc/1/. ]
 		then
 			umask 027
@@ -55,10 +55,12 @@  case "$ACTION" in
 		else
 			$DAEMON -r -c
 		fi
-		echo "$NAME."
+		[ "${VERBOSE}" != "no" ] && echo "$NAME."
 		;;
 	stop)
-		echo -n "Stopping $DESC: "
+		# stop may get called during bootup, so let it honor
+		# rcS VERBOSE setting
+		[ "${VERBOSE}" != "no" ] && echo -n "Stopping $DESC: "
 		start-stop-daemon --stop --quiet --exec $DAEMON
 
 		if [ "$STOPPER" ] && [ -f /var/log/boot ] && \
@@ -71,7 +73,7 @@  case "$ACTION" in
 			mv boot~ boot.0
 		fi
 
-		echo "$NAME."
+		[ "${VERBOSE}" != "no" ] && echo "$NAME."
 		;;
 	 restart|force-reload)
 		echo -n "Restarting $DESC: "