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

Thomas Hood jdthood-guest at costa.debian.org
Mon Nov 21 11:05:29 UTC 2005


Author: jdthood-guest
Date: 2005-11-21 11:05:29 +0000 (Mon, 21 Nov 2005)
New Revision: 176

Modified:
   sysvinit/trunk/debian/initscripts/etc/init.d/checkfs.sh
Log:
Improve message about skipping fsck; fix indentation

Modified: sysvinit/trunk/debian/initscripts/etc/init.d/checkfs.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/checkfs.sh	2005-11-21 09:34:13 UTC (rev 175)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/checkfs.sh	2005-11-21 11:05:29 UTC (rev 176)
@@ -9,9 +9,6 @@
 # Default-Stop:
 # Short-Description: Check all filesystems.
 ### END INIT INFO
-#
-# Version:	@(#)checkfs  2.85-13  22-Mar-2004  miquels at cistron.nl
-#
 
 [ -z "$FSCKFIX" ] && FSCKFIX=no
 [ -f /etc/default/rcS ] && . /etc/default/rcS
@@ -19,67 +16,72 @@
 . /lib/init/functions.sh
 
 do_start () {
-    # See if we're on AC Power
-    # If not, we're not gonna run our check
-    if [ -x /usr/bin/on_ac_power ]; then
-        /usr/bin/on_ac_power >/dev/null 2>&1
-        if [ $? -eq 1 ]; then
-            log_success_msg "On battery, not fscking!"
-            ac=no
-        fi
-    fi
+	# See if we're on AC Power
+	# If not, we're not gonna run our check
+	if [ -x /usr/bin/on_ac_power ]
+	then
+		/usr/bin/on_ac_power >/dev/null 2>&1
+		if [ $? -eq 1 ]
+		then
+			log_success_msg "Running on battery power, so skipping file system check"
+			ac=no
+		fi
+	fi
 
-    #
-    # Check the rest of the file systems.
-    #
-    if [ ! -f /fastboot ] && [ -z "$ac" ]
-    then
-        if [ -f /forcefsck ]
-        then
-            force="-f"
-        else
-            force=""
-        fi
-        if [ "$FSCKFIX"  = yes ]
-        then
-    	fix="-y"
-        else
-    	fix="-a"
-        fi
-        spinner="-C"
-        case "$TERM" in
-    	dumb|network|unknown|"") spinner="" ;;
-        esac
-        [ `uname -m` = s390 ] && spinner="" # This should go away
-	[ "$VERBOSE" != no ] && log_action_msg "Will now check all file systems"
-	fsck $spinner -T -R -A $fix $force
-        if [ $? -gt 1 ]
-        then
-		log_failure_msg "File system check failed.  Please repair manually."
-		log_success_msg "CONTROL-D will terminate this shell and continue system startup."
-		# Start a single user shell on the console
-		/sbin/sulogin $CONSOLE
-	else
-		[ "$VERBOSE" != no ] && log_success_msg "Done checking file systems"
-        fi
-    fi
-    rm -f /fastboot /forcefsck
+	#
+	# Check the rest of the file systems.
+	#
+	if [ ! -f /fastboot ] && [ -z "$ac" ]
+	then
+		if [ -f /forcefsck ]
+		then
+			force="-f"
+		else
+			force=""
+		fi
+		if [ "$FSCKFIX" = yes ]
+		then
+			fix="-y"
+		else
+			fix="-a"
+		fi
+		spinner="-C"
+		case "$TERM" in
+		  dumb|network|unknown|"")
+			spinner=""
+			;;
+		esac
+		[ `uname -m` = s390 ] && spinner=""  # This should go away
+		[ "$VERBOSE" != no ] && log_action_msg "Will now check all file systems"
+		fsck $spinner -T -R -A $fix $force
+		if [ $? -gt 1 ]
+		then
+			log_failure_msg "File system check failed. Please repair manually."
+			log_success_msg "CONTROL-D will terminate this shell and continue system startup."  # This should be something like log_info_msg but no such function exists.
+			# Start a single user shell on the console
+			/sbin/sulogin $CONSOLE
+		else
+			[ "$VERBOSE" != no ] && log_success_msg "Done checking file systems"
+		fi
+	fi
+	rm -f /fastboot /forcefsck
 }
 
 case "$1" in
-    start)
-        do_start
-        ;;
-    restart|reload|force-reload)
-        echo "Error: argument '$1' not supported" >&2
-        exit 3
-        ;;
-    stop)
-        ;;
-    *)
-        echo "Usage: $0 start|stop" >&2
-        exit 3
-        ;;
+  start)
+	do_start
+	;;
+  restart|reload|force-reload)
+	echo "Error: argument '$1' not supported" >&2
+	exit 3
+	;;
+  stop)
+	# No-op
+	;;
+  *)
+	echo "Usage: $0 start|stop" >&2
+	exit 3
+	;;
 esac
 
 : exit 0




More information about the Pkg-sysvinit-commits mailing list