[Pkg-sysvinit-commits] r277 -
sysvinit/trunk/debian/initscripts/etc/init.d
Thomas Hood
jdthood-guest at costa.debian.org
Fri Nov 25 10:01:28 UTC 2005
Author: jdthood-guest
Date: 2005-11-25 10:01:28 +0000 (Fri, 25 Nov 2005)
New Revision: 277
Modified:
sysvinit/trunk/debian/initscripts/etc/init.d/checkfs.sh
sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh
Log:
Only call log_ functions once per message. Shorten FSCK_LOGFILE var name. In VERBOSE mode, mention that the fsck log has been saved.
Modified: sysvinit/trunk/debian/initscripts/etc/init.d/checkfs.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/checkfs.sh 2005-11-25 09:30:22 UTC (rev 276)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/checkfs.sh 2005-11-25 10:01:28 UTC (rev 277)
@@ -11,7 +11,7 @@
### END INIT INFO
PATH=/bin:/sbin
-CHECKFS_FSCK_LOGFILE=/var/log/fsck/checkfs
+FSCK_LOGFILE=/var/log/fsck/checkfs
[ "$FSCKFIX" ] || FSCKFIX=no
[ "$VERBOSE" ] || VERBOSE=yes
[ -f /etc/default/rcS ] && . /etc/default/rcS
@@ -60,8 +60,11 @@
FSCKTYPES_OPT=""
[ "$FSCKTYPES" ] && FSCKTYPES_OPT="-t $FSCKTYPES"
handle_failed_fsck() {
- log_failure_msg "File system check failed. Please repair manually."
- log_failure_msg "CONTROL-D will terminate this shell and continue system startup."
+ log_failure_msg "File system check failed.
+A log has been saved in ${FSCK_LOGFILE}.
+Please repair the file system manually."
+ log_warning_msg "A maintenance shell will now be started.
+CONTROL-D will terminate this shell and resume system boot."
# Start a single user shell on the console
sulogin $CONSOLE
}
@@ -73,17 +76,17 @@
else
log_action_msg "Will now check all file systems"
fi
- logsave -s $CHECKFS_FSCK_LOGFILE fsck $spinner -V -R -A $fix $force $FSCKTYPES_OPT
+ logsave -s $FSCK_LOGFILE fsck $spinner -V -R -A $fix $force $FSCKTYPES_OPT
FSCKCODE=$?
if [ "$FSCKCODE" -gt 1 ]
then
handle_failed_fsck
else
- log_success_msg "Done checking file systems."
+ log_success_msg "Done checking file systems. Log saved in ${FSCK_LOGFILE}."
fi
else
log_action_begin_msg "Checking file systems"
- logsave -s $CHECKFS_FSCK_LOGFILE fsck $spinner -V -R -A $fix $force $FSCKTYPES_OPT >/dev/null
+ logsave -s $FSCK_LOGFILE fsck $spinner -V -R -A $fix $force $FSCKTYPES_OPT >/dev/null
FSCKCODE=$?
if [ "$FSCKCODE" -gt 1 ]
then
Modified: sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh 2005-11-25 09:30:22 UTC (rev 276)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh 2005-11-25 10:01:28 UTC (rev 277)
@@ -11,7 +11,7 @@
### END INIT INFO
PATH=/lib/init:/bin:/sbin
-CHECKROOT_FSCK_LOGFILE=/var/log/fsck/checkroot
+FSCK_LOGFILE=/var/log/fsck/checkroot
[ "$FSCKFIX" ] || FSCKFIX=no
[ "$SULOGIN" ] || SULOGIN=no
[ "$VERBOSE" ] || VERBOSE=yes
@@ -170,12 +170,12 @@
#
if [ "$rootfatal" = yes ]
then
- 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_warning_msg "Will now start a maintenance shell."
- log_warning_msg "CONTROL-D will terminate this shell and reboot the system."
+ log_failure_msg "The device node $rootdev for the root filesystem is missing or incorrect
+or there is no entry for the root filesystem listed in /etc/fstab.
+The system is also unable to create a temporary node in /dev/shm.
+This means you have to fix the problem manually."
+ log_warning_msg "A maintenance shell will now be started.
+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"
@@ -220,7 +220,7 @@
if ! mount -n -o remount,ro $rootdev / 2>/dev/null &&
! mount -n -o remount,ro /
then
- log_failure_msg "Cannot check root file system because it is not mounted read-only!"
+ log_failure_msg "Cannot check root file system because it is not mounted read-only."
rootcheck=no
fi
fi
@@ -258,17 +258,18 @@
if [ "$VERBOSE" != no ]
then
log_action_msg "Will now check root file system"
- logsave -s $CHECKROOT_FSCK_LOGFILE fsck $spinner $force $fix -V -t $roottype $rootdev
+ logsave -s $FSCK_LOGFILE fsck $spinner $force $fix -V -t $roottype $rootdev
FSCKCODE=$?
if [ "$FSCKCODE" = 0 ]
then
- log_success_msg "Done checking root file system."
+ log_success_msg "Done checking root file system. Log saved in ${FSCK_LOGFILE}."
else
- log_failure_msg "Root file system check failed with error code ${FSCKCODE}."
+ log_failure_msg "Root file system check failed with error code ${FSCKCODE}.
+A log has been saved in ${FSCK_LOGFILE}."
fi
else
log_action_begin_msg "Checking root file system"
- logsave -s $CHECKROOT_FSCK_LOGFILE fsck $spinner $force $fix -V -t $roottype $rootdev >/dev/null
+ logsave -s $FSCK_LOGFILE fsck $spinner $force $fix -V -t $roottype $rootdev >/dev/null
FSCKCODE=$?
log_action_end_msg $FSCKCODE
fi
@@ -286,22 +287,22 @@
then
# 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."
+ log_failure_msg "An automatic file system check (fsck) of the root filesystem failed.
+A manual fsck must be performed, then the system must be rebooted.
+The fsck should be performed in maintenance mode with the root
+filesystem mounted in read-only mode."
+ log_warning_msg "The root filesystem is currently mounted in read-only mode.
+A maintenance shell will now be started.
+After performing system maintenance, press CONTROL-D to terminate
+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 ]
then
- log_failure_msg "The file system check corrected errors on the root partition"
- log_failure_msg "but requested that the system be rebooted."
+ log_failure_msg "The file system check corrected errors on the root partition
+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"
More information about the Pkg-sysvinit-commits
mailing list