Viitor_upstart/etc/init/checkfs.conf
kueller 79b2635d46 Neue Version V963
git-svn-id: svn://svn.compuextreme.de/Viitor/V963/Viitor_upstart@5933 504e572c-2e33-0410-9681-be2bf7408885
2011-01-03 10:48:06 +00:00

51 lines
1.4 KiB
Plaintext

description "Check Filesystems"
author "Harald Kueller <harald.kueller@compuextreme.de>"
version 1.0
emits none special
start on stopped initlvm
console output
script
echo "running checkfs"
source /etc/init/functions
if [ ! -f /fastboot ]; then
/bin/mount -n -o remount,ro /
status_message "change / to ro ..."
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