[Pkg-sysvinit-commits] r567 - in sysvinit/trunk/debian: . initscripts/etc/init.d initscripts/lib/init

Thomas Hood jdthood-guest at costa.debian.org
Tue Jan 10 13:32:45 UTC 2006


Author: jdthood-guest
Date: 2006-01-10 13:32:42 +0000 (Tue, 10 Jan 2006)
New Revision: 567

Modified:
   sysvinit/trunk/debian/changelog
   sysvinit/trunk/debian/initscripts/etc/init.d/bootclean
   sysvinit/trunk/debian/initscripts/etc/init.d/checkfs.sh
   sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh
   sysvinit/trunk/debian/initscripts/etc/init.d/mountall.sh
   sysvinit/trunk/debian/initscripts/etc/init.d/mountnfs.sh
   sysvinit/trunk/debian/initscripts/etc/init.d/umountroot
   sysvinit/trunk/debian/initscripts/etc/init.d/urandom
   sysvinit/trunk/debian/initscripts/lib/init/vars.sh
Log:
Change handling of VERBOSE

Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog	2006-01-10 13:08:01 UTC (rev 566)
+++ sysvinit/trunk/debian/changelog	2006-01-10 13:32:42 UTC (rev 567)
@@ -9,6 +9,11 @@
     + Use ':', not the deprecated '.' between owner and group names
       in chown commands
     + Use '-o root' with install
+  * initscripts: test INIT_VERBOSE rather than VERBOSE.  The default
+    value of INIT_VERBOSE is the value of VERBOSE in /etc/default/rcS
+    but INIT_VERBOSE can be overridden by means of a kernel parameter.
+    Currently, setting INIT_VERBOSE to anything but the null string
+    or "0" makes scripts more verbose.
 
  -- Thomas Hood <jdthood at yahoo.co.uk>  Mon,  9 Jan 2006 14:16:02 +0100
 
@@ -160,9 +165,8 @@
   * all initscripts: Set variables using common script
   * all initscripts: Fix usage messages
   * all initscripts: Allow VERBOSE to be set via the INIT_VERBOSE=yes
-    kernel argument (Closes: #286082)  Experimental.  The name of the
-    kernel argument may change in the future if we decide to implement
-    this more generally.
+    kernel argument (Closes: #286082)  Experimental: see later
+    changelog entry for correct semantics.
   * Improve skeleton initscript
   * all scripts: Clean up; standardize indentation
   * all scripts: Use the "which" program to test for executability

Modified: sysvinit/trunk/debian/initscripts/etc/init.d/bootclean
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/bootclean	2006-01-10 13:08:01 UTC (rev 566)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/bootclean	2006-01-10 13:32:42 UTC (rev 567)
@@ -75,10 +75,10 @@
 
 	mkflagfile /tmp/.clean || return 1
 
-	[ "$VERBOSE" != no ] && log_action_begin_msg "Cleaning /tmp"
+	[ "$INIT_VERBOSE" ] && log_action_begin_msg "Cleaning /tmp"
 	report_err()
 	{
-		if [ "$VERBOSE" != no ]
+		if [ "$INIT_VERBOSE" ]
 		then
 			log_action_end_msg 1 "bootclean: Failure cleaning /tmp"
 		else
@@ -96,17 +96,17 @@
 		|| { report_err ; return 1 ; }
 	rm -f .X*-lock \
 		|| { report_err ; return 1 ; }
-	[ "$VERBOSE" != no ] && log_action_end_msg 0
+	[ "$INIT_VERBOSE" ] && log_action_end_msg 0
 	return 0
 }
 
 clean_lock() {
 	cd /var/lock || { log_failure_msg "bootclean: Could not cd to /var/lock." ; return 1 ; }
 
-	[ "$VERBOSE" != no ] && log_action_begin_msg "Cleaning /var/lock"
+	[ "$INIT_VERBOSE" ] && log_action_begin_msg "Cleaning /var/lock"
 	report_err()
 	{
-		if [ "$VERBOSE" != no ]
+		if [ "$INIT_VERBOSE" ]
 		then
 			log_action_end_msg 1 "bootclean: Failure cleaning /var/lock"
 		else
@@ -116,7 +116,7 @@
 	find . ! -type d \
 		-print0 | xargs -0r rm -f -- \
 		|| { report_err ; return 1 ; }
-	[ "$VERBOSE" != no ] && log_action_end_msg 0
+	[ "$INIT_VERBOSE" ] && log_action_end_msg 0
 	mkflagfile /var/lock/.clean || return 1
 	return 0
 }
@@ -124,10 +124,10 @@
 clean_run() {
 	cd /var/run || { log_action_end_msg 1 "bootclean: Could not cd to /var/run." ; return 1 ; }
 
-	[ "$VERBOSE" != no ] && log_action_begin_msg "Cleaning /var/run"
+	[ "$INIT_VERBOSE" ] && log_action_begin_msg "Cleaning /var/run"
 	report_err()
 	{
-		if [ "$VERBOSE" != no ]
+		if [ "$INIT_VERBOSE" ]
 		then
 			log_action_end_msg 1 "bootclean: Failure cleaning /var/run"
 		else
@@ -137,7 +137,7 @@
 	find . ! -xtype d ! -name utmp ! -name innd.pid \
 		-print0 | xargs -0r rm -f -- \
 		|| { report_err ; return 1 ; }
-	[ "$VERBOSE" != no ] && log_action_end_msg 0
+	[ "$INIT_VERBOSE" ] && log_action_end_msg 0
 	mkflagfile /var/run/.clean || return 1
 	return 0
 }

Modified: sysvinit/trunk/debian/initscripts/etc/init.d/checkfs.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/checkfs.sh	2006-01-10 13:08:01 UTC (rev 566)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/checkfs.sh	2006-01-10 13:32:42 UTC (rev 567)
@@ -70,7 +70,7 @@
 				sleep 5
 			fi
 		}
-		if [ "$VERBOSE" != no ]
+		if [ "$INIT_VERBOSE" ]
 		then
 			if [ "$FSCKTYPES" ]
 			then

Modified: sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh	2006-01-10 13:08:01 UTC (rev 566)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh	2006-01-10 13:32:42 UTC (rev 567)
@@ -117,7 +117,7 @@
 	  Linux:2.[0123].*)
 		if [ "$swap_on_md" = yes ] && grep -qs resync /proc/mdstat
 		then
-			[ "$VERBOSE" != no ] && log_warning_msg "Not activating swap because RAID array is resyncing."
+			[ "$INIT_VERBOSE" ] && log_warning_msg "Not activating swap because RAID array is resyncing."
 		else
 			doswap=yes
 		fi
@@ -128,7 +128,7 @@
 	esac
 	if [ "$doswap" = yes ]
 	then
-		if [ "$VERBOSE" != no ]
+		if [ "$INIT_VERBOSE" ]
 		then
 			log_action_msg "Will now activate swap"
 			swapon -a
@@ -272,7 +272,7 @@
 			spinner=""
 		fi
 		
-		if [ "$VERBOSE" != no ]
+		if [ "$INIT_VERBOSE" ]
 		then
 			log_action_msg "Will now check root file system"
 			logsave -s $FSCK_LOGFILE fsck $spinner $force $fix -V -t $roottype $rootdev

Modified: sysvinit/trunk/debian/initscripts/etc/init.d/mountall.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/mountall.sh	2006-01-10 13:08:01 UTC (rev 566)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/mountall.sh	2006-01-10 13:32:42 UTC (rev 567)
@@ -31,7 +31,7 @@
 
 	do_mount() { mount -av -t nonfs,nonfs4,nosmbfs,nocifs,noncp,noncpfs,nocoda,noocfs2,nogfs ; }
 
-	if [ "$VERBOSE" != no ]
+	if [ "$INIT_VERBOSE" ]
 	then
 		log_action_msg "Will now mount local filesystems"
 		do_mount

Modified: sysvinit/trunk/debian/initscripts/etc/init.d/mountnfs.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/mountnfs.sh	2006-01-10 13:08:01 UTC (rev 566)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/mountnfs.sh	2006-01-10 13:32:42 UTC (rev 567)
@@ -98,7 +98,7 @@
 		# the problem of mount reporting an error status when
 		# some filesystems are already mounted.
 
-		if [ "$VERBOSE" != no ]
+		if [ "$INIT_VERBOSE" ]
 		then
 			log_action_msg "Will now mount remote filesystems"
 			do_mount

Modified: sysvinit/trunk/debian/initscripts/etc/init.d/umountroot
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/umountroot	2006-01-10 13:08:01 UTC (rev 566)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/umountroot	2006-01-10 13:32:42 UTC (rev 567)
@@ -14,7 +14,7 @@
 . /lib/lsb/init-functions
 
 do_stop () {
-	[ "$VERBOSE" != no ] && log_action_begin_msg "Mounting root filesystem read-only"
+	[ "$INIT_VERBOSE" ] && log_action_begin_msg "Mounting root filesystem read-only"
 	MOUNT_FORCE_OPT=
 	[ "$(uname -s)" = "GNU/kFreeBSD" ] && MOUNT_FORCE_OPT=-f
 	# This:
@@ -25,7 +25,7 @@
 	|| mount $MOUNT_FORCE_OPT -n -o remount,ro              dummydev / 2>/dev/null \
 	|| mount $MOUNT_FORCE_OPT -n -o remount,ro                       / 2>/dev/null
 	ES=$?
-	[ "$VERBOSE" != no ] && log_action_end_msg $ES
+	[ "$INIT_VERBOSE" ] && log_action_end_msg $ES
 }
 
 case "$1" in

Modified: sysvinit/trunk/debian/initscripts/etc/init.d/urandom
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/urandom	2006-01-10 13:08:01 UTC (rev 566)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/urandom	2006-01-10 13:32:42 UTC (rev 567)
@@ -25,7 +25,7 @@
 
 case "$1" in
   start|"")
-	[ "$VERBOSE" != no ] && log_action_begin_msg "Initializing random number generator"
+	[ "$INIT_VERBOSE" ] && log_action_begin_msg "Initializing random number generator"
 	# Load and then save $POOLSIZE bytes,
 	# which is the size of the entropy pool
 	if [ -f "$SAVEDFILE" ]
@@ -44,16 +44,16 @@
 	dd if=/dev/urandom of=$SAVEDFILE bs=$POOLSIZE count=1 >/dev/null 2>&1
 	ES=$?
 	umask 022
-	[ "$VERBOSE" != no ] && log_action_end_msg $ES
+	[ "$INIT_VERBOSE" ] && log_action_end_msg $ES
 	;;
   stop)
 	# Carry a random seed from shut-down to start-up;
 	# see documentation in linux/drivers/char/random.c
-	[ "$VERBOSE" != no ] && log_action_begin_msg "Saving random seed"
+	[ "$INIT_VERBOSE" ] && log_action_begin_msg "Saving random seed"
 	umask 077
 	dd if=/dev/urandom of=$SAVEDFILE bs=$POOLSIZE count=1 >/dev/null 2>&1
 	ES=$?
-	[ "$VERBOSE" != no ] && log_action_end_msg $ES
+	[ "$INIT_VERBOSE" ] && log_action_end_msg $ES
 	;;
   restart|reload|force-reload)
 	echo "Error: argument '$1' not supported" >&2

Modified: sysvinit/trunk/debian/initscripts/lib/init/vars.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/lib/init/vars.sh	2006-01-10 13:08:01 UTC (rev 566)
+++ sysvinit/trunk/debian/initscripts/lib/init/vars.sh	2006-01-10 13:32:42 UTC (rev 567)
@@ -3,4 +3,20 @@
 #
 
 [ -f /etc/default/rcS ] && . /etc/default/rcS
-[ "$INIT_VERBOSE" ] && VERBOSE="$INIT_VERBOSE"
+
+#
+# VERBOSE is the default value for INIT_VERBOSE which can be overridden
+# by means of a kernel parameter
+#
+if [ "$VERBOSE" ] && ! [ "$INIT_VERBOSE" ]
+then
+	case "$VERBOSE" in
+		y*|Y*) INIT_VERBOSE=1 ;;
+		*) INIT_VERBOSE=0 ;;
+	esac
+fi
+
+case "$INIT_VERBOSE" in
+	""|0) INIT_VERBOSE="" ;;  # Be non-verbose
+	*) INIT_VERBOSE=1 ;;      # Be verbose
+esac




More information about the Pkg-sysvinit-commits mailing list