5 # Required-Stop: umountfs
6 # Should-Stop: $network $portmap nfs-common
9 # Short-Description: Unmount all network filesystems except the root fs.
10 # Description: Also unmounts all virtual filesystems (proc, devfs,
11 # devpts, usbfs, sysfs) that are not mounted at the
15 PATH=/sbin:/usr/sbin:/bin:/usr/bin
20 . /lib/lsb/init-functions
22 case "${KERNEL}:${RELEASE}" in
23 Linux:[01].*|Linux:2.[01].*)
26 Linux:2.[23].*|Linux:2.4.?|Linux:2.4.?-*|Linux:2.4.10|Linux:2.4.10-*)
35 # Write a reboot record to /var/log/wtmp before unmounting
38 # Remove bootclean flag files (precaution against symlink attacks)
39 rm -f /tmp/.clean /var/lock/.clean /var/run/.clean
42 # Make list of points to unmount in reverse order of their creation
48 while read -r DEV MTPT FSTYPE OPTS REST
51 /|/proc|/dev|/dev/pts|/dev/shm|/proc/*|/sys|/lib/init/rw)
55 if [ yes = "$RAMRUN" ] ; then
60 if [ yes = "$RAMLOCK" ] ; then
66 nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs)
69 proc|procfs|linprocfs|devfs|devpts|usbfs|usbdevfs|sysfs)
74 _netdev|*,_netdev|_netdev,*|*,_netdev,*)
84 [ "$VERBOSE" = no ] || log_action_begin_msg "Unmounting remote and non-toplevel virtual filesystems"
85 fstab-decode umount $FLAGS $DIRS
87 [ "$VERBOSE" = no ] || log_action_end_msg $ES
95 restart|reload|force-reload)
96 echo "Error: argument '$1' not supported" >&2
103 echo "Usage: umountnfs.sh [start|stop]" >&2