[Pkg-sysvinit-commits] r195 - sysvinit/trunk/debian/initscripts/etc/init.d

Thomas Hood jdthood-guest at costa.debian.org
Mon Nov 21 12:20:03 UTC 2005


Author: jdthood-guest
Date: 2005-11-21 12:20:01 +0000 (Mon, 21 Nov 2005)
New Revision: 195

Modified:
   sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh
Log:
Remove old Miquel version comment; fix indentation and formatting

Modified: sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh	2005-11-21 12:15:58 UTC (rev 194)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh	2005-11-21 12:20:01 UTC (rev 195)
@@ -21,9 +21,9 @@
 
 do_start () {
 	#
-	#	Set SULOGIN in /etc/default/rcS to yes if you want a sulogin to
-	#	be spawned from this script *before anything else* with a timeout,
-	#	like sysv does.
+	# Set SULOGIN in /etc/default/rcS to yes if you want a sulogin to
+	# be spawned from this script *before anything else* with a timeout,
+	# like sysv does.
 	#
 	[ "$SULOGIN" = yes ] && sulogin -t 30 $CONSOLE
 
@@ -32,9 +32,9 @@
 	MACHINE=`uname -m`
 
 	#
-	#	Ensure that bdflush (update) is running before any major I/O is
-	#	performed (the following fsck is a good example of such activity :).
-	#	Only needed for kernels < 2.4.
+	# Ensure that bdflush (update) is running before any major I/O is
+	# performed (the following fsck is a good example of such activity :).
+	# Only needed for kernels < 2.4.
 	#
 	if [ -x /sbin/update ] && [ "$KERNEL" = Linux ]
 	then
@@ -46,7 +46,7 @@
 	fi
 
 	#
-	#	Read /etc/fstab.
+	# Read /etc/fstab.
 	#
 exec 9>&0 </etc/fstab
 	fstabroot=/dev/root
@@ -60,29 +60,28 @@
 	while read dev mnt type opts dump pass junk
 	do
 		case "$dev" in
-			""|\#*)
-				continue;
-				;;
-			/dev/md*)
-				# Swap on md device.
-				[ "$type" = swap ] && swap_on_md=yes
-				;;
-			/dev/*)
-				;;
-	 		LABEL=*|UUID=*)
-	 			[ -x /sbin/findfs ] && dev="`/sbin/findfs \"$dev\"`"
-				;;
-			*)
-				# Devfs definition ?
-				if [ "$type" = "devfs" ] && [ "$mnt" = /dev ] &&
-					mountpoint -q /dev
-				then
-					devfs="-t $type $dev $mnt"
-				fi
-	
-				# Might be a swapfile.
-				[ "$type" = swap ] && swap_on_md=yes
-				;;
+		  ""|\#*)
+			continue;
+			;;
+		  /dev/md*)
+			# Swap on md device.
+			[ "$type" = swap ] && swap_on_md=yes
+			;;
+		  /dev/*)
+			;;
+	 	  LABEL=*|UUID=*)
+	 		[ -x /sbin/findfs ] && dev="`/sbin/findfs \"$dev\"`"
+			;;
+		  *)
+			# Devfs definition ?
+			if [ "$type" = "devfs" ] && [ "$mnt" = /dev ] &&
+				mountpoint -q /dev
+			then
+				devfs="-t $type $dev $mnt"
+			fi
+			# Might be a swapfile.
+			[ "$type" = swap ] && swap_on_md=yes
+			;;
 		esac
 		[ "$mnt" != / ] && continue
 		rootdev="$dev"
@@ -92,31 +91,30 @@
 		( [ "$pass" != 0 ] && [ "$pass" != "" ]   ) && rootcheck=yes
 		( [ "$type" = nfs ] || [ "$type" = nfs4 ] ) && rootcheck=no
 		case "$opts" in
-			ro|ro,*|*,ro|*,ro,*)
-				rootmode=ro
-				;;
+		  ro|ro,*|*,ro|*,ro,*)
+			rootmode=ro
+			;;
 		esac
 	done
 	exec 0>&9 9>&-
 
 	#
-	#	Activate the swap device(s) in /etc/fstab. This needs to be done
-	#	before fsck, since fsck can be quite memory-hungry.
+	# Activate the swap device(s) in /etc/fstab. This needs to be done
+	# before fsck, since fsck can be quite memory-hungry.
 	#
 	doswap=no
 	case "${KERNEL}:${RELEASE}" in
-		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."
-			else
-				doswap=yes
-			fi
-			;;
-		*)
+	  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."
+		else
 			doswap=yes
-			;;
+		fi
+		;;
+	  *)
+		doswap=yes
+		;;
 	esac
 	if [ "$doswap" = yes ]
 	then
@@ -133,9 +131,9 @@
 	fi
 
 	#
-	#	Does the root device in /etc/fstab match with the actual device ?
-	#	If not we try to use the /dev/root alias device, and if that
-	#	fails we create a temporary node in /dev/shm.
+	# Does the root device in /etc/fstab match with the actual device ?
+	# If not we try to use the /dev/root alias device, and if that
+	# fails we create a temporary node in /dev/shm.
 	#
 	if [ "$rootcheck" = yes ]
 	then
@@ -158,7 +156,7 @@
 	fi
 
 	#
-	#	Bother, said Pooh.
+	# Bother, said Pooh.
 	#
 	if [ "$rootfatal" = yes ]
 	then
@@ -185,7 +183,7 @@
 	fi
 
 	#
-	#	See if we want to check the root file system.
+	# See if we want to check the root file system.
 	#
 	FSCKCODE=0
 	if [ -f /fastboot ]
@@ -218,7 +216,7 @@
 	fi
 
 	#
-	#	The actual checking is done here.
+	# The actual checking is done here.
 	#
 	if [ "$rootcheck" = yes ]
 	then
@@ -238,8 +236,8 @@
 
 		spinner="-C"
 		case "$TERM" in
-			dumb|network|unknown|"")
-				spinner="" ;;
+		  dumb|network|unknown|"")
+			spinner="" ;;
 		esac
 		# This Linux/s390 special case should go away.
 		if [ "${KERNEL}:${MACHINE}" = Linux:s390 ]
@@ -258,12 +256,12 @@
 	fi
 
 	#
-	#	If there was a failure, drop into single-user mode.
+	#  If there was a failure, drop into single-user mode.
 	#
-	#	NOTE: "failure" is defined as exiting with a return code of
-	#	4 or larger.  A return code of 1 indicates that file system
-	#	errors were corrected but that the boot may proceed. A return
-	#	code of 2 or 3 indicates that the system should immediately reboot.
+	#  NOTE: "failure" is defined as exiting with a return code of
+	#  4 or larger.  A return code of 1 indicates that file system
+	#  errors were corrected but that the boot may proceed. A return
+	#  code of 2 or 3 indicates that the system should immediately reboot.
 	#
 	if [ "$FSCKCODE" -gt 3 ]
 	then
@@ -292,10 +290,10 @@
 	fi
 
 	#
-	#	Remount root to final mode (rw or ro).
+	#  Remount root to final mode (rw or ro).
 	#
-	#	See the comments above at the previous "mount -o remount"
-	#	for an explanation why we try this twice.
+	#  See the comments above at the previous "mount -o remount"
+	#  for an explanation why we try this twice.
 	#
 	if ! mount -n -o remount,$rootopts,$rootmode $fstabroot / 2>/dev/null
 	then
@@ -303,31 +301,31 @@
 	fi
 
 	#
-	#	We only create/modify /etc/mtab if the location where it is
-	#	stored is writable.  If /etc/mtab is a symlink into /proc/
-	#	then it is not writable.
+	#  We only create/modify /etc/mtab if the location where it is
+	#  stored is writable.  If /etc/mtab is a symlink into /proc/
+	#  then it is not writable.
 	#
 	init_mtab=no
 	MTAB_PATH="`readlink -f /etc/mtab || :`"
 	case "$MTAB_PATH" in
-		/proc/*)
-			;;
-		/*)
-			if touch $MTAB_PATH >/dev/null 2>&1
-			then
-				:> $MTAB_PATH
-				rm -f ${MTAB_PATH}~
-				init_mtab=yes
-			fi
-			;;
-		"")
-			[ -L /etc/mtab ] && MTAB_PATH="`readlink /etc/mtab`"
-			if [ "$MTAB_PATH" ] ; then
-				log_failure_msg "Cannot initialize ${MTAB_PATH}."
-			else
-				log_failure_msg "Cannot initialize the mtab file."
-			fi
-			;;
+	  /proc/*)
+		;;
+	  /*)
+		if touch $MTAB_PATH >/dev/null 2>&1
+		then
+			:> $MTAB_PATH
+			rm -f ${MTAB_PATH}~
+			init_mtab=yes
+		fi
+		;;
+	  "")
+		[ -L /etc/mtab ] && MTAB_PATH="`readlink /etc/mtab`"
+		if [ "$MTAB_PATH" ] ; then
+			log_failure_msg "Cannot initialize ${MTAB_PATH}."
+		else
+			log_failure_msg "Cannot initialize the mtab file."
+		fi
+		;;
 	esac
 
 	if [ "$init_mtab" = yes ]
@@ -339,7 +337,7 @@
 	fi
 
 	#
-	#	Remove /dev/shm/root if we created it.
+	# Remove /dev/shm/root if we created it.
 	#
 	rm -f /dev/shm/root
 }
@@ -353,6 +351,7 @@
 	exit 3
 	;;
   stop)
+	# No-op
 	;;
   *)
 	echo "Usage: $0 start|stop" >&2




More information about the Pkg-sysvinit-commits mailing list