From 5238ad5a0c4a9e1c8cd036f5de4055e39bd71297 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Fri, 29 Apr 2011 09:09:27 +0200 Subject: added debootstrap stuff Signed-off-by: Manuel Traut --- beagle/debian-rfs/etc/init.d/umountnfs.sh | 108 ++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100755 beagle/debian-rfs/etc/init.d/umountnfs.sh (limited to 'beagle/debian-rfs/etc/init.d/umountnfs.sh') diff --git a/beagle/debian-rfs/etc/init.d/umountnfs.sh b/beagle/debian-rfs/etc/init.d/umountnfs.sh new file mode 100755 index 0000000..55fa96f --- /dev/null +++ b/beagle/debian-rfs/etc/init.d/umountnfs.sh @@ -0,0 +1,108 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: umountnfs +# Required-Start: +# Required-Stop: umountfs +# Should-Stop: $network $portmap nfs-common +# Default-Start: +# Default-Stop: 0 6 +# Short-Description: Unmount all network filesystems except the root fs. +# Description: Also unmounts all virtual filesystems (proc, +# devpts, usbfs, sysfs) that are not mounted at the +# top level. +### END INIT INFO + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +KERNEL="$(uname -s)" +RELEASE="$(uname -r)" +. /lib/init/vars.sh + +. /lib/lsb/init-functions + +case "${KERNEL}:${RELEASE}" in + Linux:[01].*|Linux:2.[01].*) + FLAGS="" + ;; + Linux:2.[23].*|Linux:2.4.?|Linux:2.4.?-*|Linux:2.4.10|Linux:2.4.10-*) + FLAGS="-f" + ;; + *) + FLAGS="-f -l" + ;; +esac + +do_stop () { + # Write a reboot record to /var/log/wtmp before unmounting + halt -w + + # Remove bootclean flag files (precaution against symlink attacks) + rm -f /tmp/.clean /var/lock/.clean /var/run/.clean + + # + # Make list of points to unmount in reverse order of their creation + # + + exec 9<&0 &2 + exit 3 + ;; + stop|"") + do_stop + ;; + *) + echo "Usage: umountnfs.sh [start|stop]" >&2 + exit 3 + ;; +esac + +: -- cgit v1.2.3