5 # Required-Stop: umountroot
8 # Short-Description: Turn off swap and unmount all local file systems.
12 PATH=/sbin:/usr/sbin:/bin:/usr/bin
15 . /lib/lsb/init-functions
20 exec 9<&0 </proc/mounts
24 while read -r DEV MTPT FSTYPE REST
27 /|/proc|/dev|/.dev|/dev/pts|/dev/shm|/dev/.static/dev|/proc/*|/sys|/lib/init/rw)
31 if [ yes = "$RAMRUN" ] ; then
36 if [ yes = "$RAMLOCK" ] ; then
42 proc|procfs|linprocfs|devfs|sysfs|usbfs|usbdevfs|devpts)
46 TMPFS_MTPTS="$MTPT $TMPFS_MTPTS"
49 REG_MTPTS="$MTPT $REG_MTPTS"
57 # Make sure tmpfs file systems are umounted before turning off
58 # swap, to avoid running out of memory if the tmpfs filesystems
63 if [ "$VERBOSE" = no ]
65 log_action_begin_msg "Unmounting temporary filesystems"
66 fstab-decode umount $TMPFS_MTPTS
69 log_daemon_msg "Will now unmount temporary filesystems"
70 fstab-decode umount -v $TMPFS_MTPTS
78 if [ "$VERBOSE" = no ]
80 log_action_begin_msg "Deactivating swap"
84 log_daemon_msg "Will now deactivate swap"
90 # Unmount local filesystems
94 if [ "$VERBOSE" = no ]
96 log_action_begin_msg "Unmounting local filesystems"
97 fstab-decode umount -f -r -d $REG_MTPTS
100 log_daemon_msg "Will now unmount local filesystems"
101 fstab-decode umount -f -v -r -d $REG_MTPTS
111 restart|reload|force-reload)
112 echo "Error: argument '$1' not supported" >&2
119 echo "Usage: $0 start|stop" >&2