This file is indexed.

/etc/init.d/umountfs is in initscripts 2.88dsf-59.9.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#! /bin/sh
### BEGIN INIT INFO
# Provides:          umountfs
# Required-Start:
# Required-Stop:     umountroot
# Default-Start:
# Default-Stop:      0 6
# Short-Description: Turn off swap and unmount all local file systems.
# Description:
### END INIT INFO

PATH=/sbin:/usr/sbin:/bin:/usr/bin
. /lib/init/vars.sh

. /lib/lsb/init-functions

umask 022

do_stop () {
	PROTECTED_MOUNTS="$(sed -n ':a;/^[^ ]* \(\/\|\/usr\) /!{H;n;ba};{H;s/.*//;x;s/\n//;p}' /proc/mounts)"
	WEAK_MTPTS="" # be gentle, don't use force
	REG_MTPTS=""
	TMPFS_MTPTS=""
	while read -r DEV MTPT FSTYPE REST
	do
		echo "$PROTECTED_MOUNTS" | grep -qs "^$DEV $MTPT " && continue
		case "$MTPT" in
		  /|/proc|/dev|/.dev|/dev/pts|/dev/shm|/dev/.static/dev|/proc/*|/sys|/sys/*|/run|/run/*|/dev/vcs)
			continue
			;;
		esac
		case "$FSTYPE" in
		  proc|procfs|linprocfs|sysfs|usbfs|usbdevfs|devpts)
			continue
			;;
		  tmpfs)
			TMPFS_MTPTS="$MTPT $TMPFS_MTPTS"
			;;
		  *)
			if echo "$PROTECTED_MOUNTS" | grep -qs "^$DEV "; then
				WEAK_MTPTS="$MTPT $WEAK_MTPTS"
			else
				REG_MTPTS="$MTPT $REG_MTPTS"
			fi
			;;
		esac
	done < /proc/mounts

	#
	# Make sure tmpfs file systems are umounted before turning off
	# swap, to avoid running out of memory if the tmpfs filesystems
	# use a lot of space.
	#
	if [ "$TMPFS_MTPTS" ]
	then
		if [ "$VERBOSE" = no ]
		then
			log_action_begin_msg "Unmounting temporary filesystems"
			fstab-decode umount $TMPFS_MTPTS
			log_action_end_msg $?
		else
			log_daemon_msg "Will now unmount temporary filesystems"
			fstab-decode umount -v $TMPFS_MTPTS
			log_end_msg $?
		fi
	fi

	#
	# Deactivate swap
	#
	if [ "$VERBOSE" = no ]
	then
		log_action_begin_msg "Deactivating swap"
		swapoff -a >/dev/null
		log_action_end_msg $?
	else
		log_daemon_msg "Will now deactivate swap"
		swapoff -a -v
		log_end_msg $?
	fi

	#
	# Unmount local filesystems
	#
	if [ "$WEAK_MTPTS" ]; then
		# Do not use -f umount option for WEAK_MTPTS
		if [ "$VERBOSE" = no ]
		then
			log_action_begin_msg "Unmounting weak filesystems"
			fstab-decode umount -r -d $WEAK_MTPTS
			log_action_end_msg $?
		else
			log_daemon_msg "Will now unmount weak filesystems"
			fstab-decode umount -v -r -d $WEAK_MTPTS
			log_end_msg $?
		fi
	fi
	if [ "$REG_MTPTS" ]
	then
		if [ "$VERBOSE" = no ]
		then
			log_action_begin_msg "Unmounting local filesystems"
			fstab-decode umount -f -r -d $REG_MTPTS
			log_action_end_msg $?
		else
			log_daemon_msg "Will now unmount local filesystems"
			fstab-decode umount -f -v -r -d $REG_MTPTS
			log_end_msg $?
		fi
	fi
}

case "$1" in
  start|status)
	# No-op
	;;
  restart|reload|force-reload)
	echo "Error: argument '$1' not supported" >&2
	exit 3
	;;
  stop)
	do_stop
	;;
  *)
	echo "Usage: $0 start|stop" >&2
	exit 3
	;;
esac

: