[Pkg-sysvinit-commits] r178 -
sysvinit/trunk/debian/initscripts/etc/init.d
Thomas Hood
jdthood-guest at costa.debian.org
Mon Nov 21 11:28:40 UTC 2005
Author: jdthood-guest
Date: 2005-11-21 11:28:39 +0000 (Mon, 21 Nov 2005)
New Revision: 178
Modified:
sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh
Log:
Improve messages; fix bug in handling of FSCKCODE
Modified: sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh 2005-11-21 11:09:25 UTC (rev 177)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh 2005-11-21 11:28:39 UTC (rev 178)
@@ -162,13 +162,15 @@
#
if [ "$rootfatal" = yes ]
then
- log_failure_msg "The device node $rootdev for the root filesystem is missing, incorrect,"
+ log_failure_msg "The device node $rootdev for the root filesystem is missing or incorrect"
log_failure_msg "or there is no entry for the root filesystem listed in /etc/fstab."
log_failure_msg "The system is also unable to create a temporary node in /dev/shm."
log_failure_msg "This means you have to fix the problem manually."
- log_failure_msg "CONTROL-D will terminate this shell and REBOOT the system."
+ log_warning_msg "Will now start a maintenance shell."
+ log_warning_msg "CONTROL-D will terminate this shell and reboot the system."
# Start a single user shell on the console
/sbin/sulogin $CONSOLE
+ log_action_msg "Will now reboot"
reboot -f
fi
@@ -246,13 +248,13 @@
fi
log_action_msg "Will now check root file system"
fsck $spinner $force $fix -T -t $roottype $rootdev
- if [ "$?" = 0 ]
+ FSCKCODE=$?
+ if [ "$FSCKCODE" = 0 ]
then
- log_success_msg "Done checking root file system"
+ log_success_msg "Done checking root file system."
else
- log_failure_msg "Done checking root file system"
+ log_failure_msg "Root file system check failed with error code ${FSCKCODE}."
fi
- FSCKCODE=$?
fi
#
@@ -263,29 +265,29 @@
# 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 ]
+ if [ "$FSCKCODE" -gt 3 ]
then
- # Surprise! Re-directing from a HERE document (as in
- # "cat << EOF") won't work, because the root is read-only.
- log_failure_msg "An automatic file system check of the root filesystem failed."
- log_failure_msg "A manual fsck must be performed, then the system rebooted."
- log_failure_msg "This fsck can be performed in maintenance mode."
- log_failure_msg "Please note that the root filesystem is currently mounted read-only."
- log_failure_msg "The fsck should only be performed while the root filesystem is "
- log_failure_msg "mounted read-only. However, the command to remount it read-write "
- log_failure_msg "is:"
- log_failure_msg " # mount -n -o remount,rw /"
- log_failure_msg "In order to exit from the maintenance shell, press CONTROL-D"
- log_failure_msg "and the system will REBOOT."
+ # Surprise! Re-directing from a HERE document (as in "cat << EOF")
+ # does not work because the root is currently read-only.
+ log_failure_msg "An automatic file system check (fsck) of the root filesystem failed."
+ log_failure_msg "A manual fsck must be performed, then the system must be rebooted."
+ log_warning_msg "The fsck should be performed in maintenance mode with the root "
+ log_warning_msg "filesystem mounted in read-only mode."
+ log_warning_msg "The root filesystem is currently mounted in read-only mode."
+ log_warning_msg "Will now start a maintenance shell."
+ log_warning_msg "After performing system maintenance, press CONTROL-D to terminate "
+ log_warning_msg "the maintenance shell and reboot the system."
# Start a single user shell on the console
/sbin/sulogin $CONSOLE
+ log_action_msg "Will now reboot"
reboot -f
- elif [ $FSCKCODE -gt 1 ]
+ elif [ "$FSCKCODE" -gt 1 ]
then
- log_failure_msg "The file system check program corrected errors on the root partition,"
- log_failure_msg "but requested that the system be rebooted (exit code $FSCKCODE)."
- log_failure_msg "Automatic reboot in 5 seconds."
+ log_failure_msg "The file system check corrected errors on the root partition"
+ log_failure_msg "but requested that the system be rebooted."
+ log_warning_msg "The system will be rebooted in 5 seconds."
sleep 5
+ log_action_msg "Will now reboot"
reboot -f
fi
@@ -321,9 +323,9 @@
"")
[ -L /etc/mtab ] && MTAB_PATH="`readlink /etc/mtab`"
if [ "$MTAB_PATH" ] ; then
- log_failure_msg "Cannot initialize $MTAB_PATH"
+ log_failure_msg "Cannot initialize ${MTAB_PATH}."
else
- log_failure_msg "Cannot initialize the mtab file"
+ log_failure_msg "Cannot initialize the mtab file."
fi
;;
esac
More information about the Pkg-sysvinit-commits
mailing list