Viitor_upstart/etc/event.d/mountfs
kueller 7b7f6e837b V961 Tree Umbau
git-svn-id: svn://svn.compuextreme.de/Viitor/V961/Viitor_upstart@4329 504e572c-2e33-0410-9681-be2bf7408885
2008-05-03 16:59:18 +00:00

55 lines
1.5 KiB
Plaintext

# rcS - runlevel compatibility
#
# This task runs the old sysv-rc startup scripts.
start on stopped checkfs
stop on shutdown
stop on runlevel 6
stop on runlevel 0
description "Mount all Filesystem which are not NFS"
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
pre-start script
source /etc/init.d/functions
echo -n "Remounting rootfs in rw mode..."
/bin/mount -n -o remount,rw /
evaluate_retval
echo >/etc/mtab
/bin/mount -f -o remount,rw /
/bin/rm -f /fastboot /forcefsck
echo -n "Activating swap..."
/sbin/swapon -a
evaluate_retval
for i in `sed -e "/^#/d" /etc/fstab|awk '{print $2}'`; do
MOUNTPOINT=$i
FILESYSTEM=`awk '{if( $2 == "'$MOUNTPOINT'") print $3}' /etc/fstab`
DEVICE=`awk '{if( $2 == "'$MOUNTPOINT'") print $1}' /etc/fstab`
if [ ! "$FILESYSTEM" == "nfs" ] \
&& [ ! "$FILESYSTEM" == "swap" ] \
&& [ ! "$MOUNTPOINT" == "/" ] \
&& [ ! "$DEVICE" == "none" ]; then
echo -n "Mounting $MOUNTPOINT"
mount $MOUNTPOINT
evaluate_retval
fi
done
end script
post-stop script
source /etc/init.d/functions
echo -n "Deactivating swap..."
/sbin/swapoff -a
evaluate_retval
echo -n "Unmounting file systems..."
/bin/umount -a -r
evaluate_retval
end script