2008-05-03 17:03:02 +00:00
|
|
|
# rcS - runlevel compatibility
|
|
|
|
#
|
|
|
|
# This task runs the old sysv-rc startup scripts.
|
|
|
|
|
|
|
|
start on stopped initlvm
|
|
|
|
|
|
|
|
#stop on runlevel
|
|
|
|
|
|
|
|
description "Check Filesystems"
|
|
|
|
author "Harald Kueller <harald.kueller@compuextreme.de>"
|
|
|
|
|
|
|
|
# Note: there can be no previous runlevel here, if we have one it's bad
|
|
|
|
# information (we enter rc1 not rcS for maintenance). Run /etc/init.d/rc
|
|
|
|
# without information so that it defaults to previous=N runlevel=S.
|
|
|
|
console output
|
|
|
|
script
|
2010-01-28 13:58:15 +00:00
|
|
|
source /etc/event.d/functions
|
2008-05-03 17:03:02 +00:00
|
|
|
if [ -f /fastboot ]; then
|
|
|
|
echo "Fast boot, no file system check"
|
|
|
|
else
|
|
|
|
/bin/mount -n -o remount,ro /
|
2010-01-28 13:58:15 +00:00
|
|
|
status_message "change / to ro ..."
|
2008-05-03 17:03:02 +00:00
|
|
|
if [ $? = 0 ]; then
|
|
|
|
if [ -f /forcefsck ]; then
|
|
|
|
echo -n "/forcefsck exists, forcing "
|
|
|
|
echo "file system check"
|
|
|
|
force="-f"
|
|
|
|
else
|
|
|
|
force=""
|
|
|
|
fi
|
|
|
|
echo "Checking file systems..."
|
|
|
|
/sbin/fsck $force -a -A -C -T
|
|
|
|
|
|
|
|
if [ $? -gt 1 ]; then
|
|
|
|
$FAILURE
|
|
|
|
echo
|
|
|
|
echo -n "fsck failed. Please repair your file "
|
|
|
|
echo "systems manually by running /sbin/fsck"
|
|
|
|
echo "without the -a option"
|
|
|
|
echo
|
|
|
|
echo -n "Please note that the root file system "
|
|
|
|
echo "is currently mounted in read-only mode."
|
|
|
|
echo
|
|
|
|
echo -n "I will start sulogin now. When you "
|
|
|
|
echo "logout I will reboot your system."
|
|
|
|
echo
|
|
|
|
$NORMAL
|
|
|
|
/sbin/initctl emit stalled
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
print_status success
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo -n "Cannot check root file system because it "
|
|
|
|
echo "could not be mounted in read-only mode."
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
end script
|