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/network/if-up.d/mountnfs | 173 +++++++++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100755 beagle/debian-rfs/etc/network/if-up.d/mountnfs (limited to 'beagle/debian-rfs/etc/network') diff --git a/beagle/debian-rfs/etc/network/if-up.d/mountnfs b/beagle/debian-rfs/etc/network/if-up.d/mountnfs new file mode 100755 index 0000000..3564cfd --- /dev/null +++ b/beagle/debian-rfs/etc/network/if-up.d/mountnfs @@ -0,0 +1,173 @@ +#! /bin/sh +# Description: Now that TCP/IP is configured, mount the NFS file +# systems in /etc/fstab if needed. If possible, +# start the portmapper before mounting (this is needed for +# Linux 2.1.x and up). +# +# Also mounts SMB filesystems now, so the name of +# this script is getting increasingly inaccurate. + +PATH=/sbin:/bin +. /lib/init/vars.sh + +. /lib/lsb/init-functions +. /lib/init/mount-functions.sh + +set_env() { + [ -f /etc/fstab ] || return + # + # Read through fstab line by line. If it is NFS, set the flag + # for mounting NFS file systems. If any NFS partition is found and it + # not mounted with the nolock option, we start the portmapper. + # + # If any sec={krb5,krb5i,krb5p} option is given, or any of the file + # systems are nfs4, we'll need to start rpc.gssd and/or rpc.idmapd too; + # we'll leave that to nfs-common. + # + + exec 9<&0 /dev/null + fi + done + if [ -d /var/run/network/mountnfs_earlyexit ]; then + rmdir /var/run/network/mountnfs_earlyexit 2>/dev/null + exit 0 + fi +} + +# Using 'no !=' instead of 'yes =' to make sure async nfs mounting is +# the default even without a value in /etc/default/rcS +set_env +# Exit imediately and do not claim to wait for the last interface if +# no network file systems are listed in /etc/fstab. +if [ "$start_nfs" = "no" ] && [ ! "$NETFS" ] && [ ! "$NETDEV" ]; then + exit 0 +fi + +if [ no != "$ASYNCMOUNTNFS" ]; then + # Not for loopback! + [ "$IFACE" != "lo" ] || exit 0 + + # Lock around this otherwise insanity may occur + mkdir /var/run/network 2>/dev/null || true + + # Wait until all auto interfaces are up before attemting to mount + # network file systems. + exit_unless_last_interface + + if mkdir /var/run/network/mountnfs 2>/dev/null ; then + : + else + msg="if-up.d/mountnfs[$IFACE]: lock /var/run/network/mountnfs exist, not mounting" + log_failure_msg "$msg" + # Log if /usr/ is mounted + [ -x /usr/bin/logger ] && /usr/bin/logger -t "if-up.d/mountnfs[$IFACE]" "$msg" + exit 0 + fi + + on_exit() { + # Clean up lock when script exits, even if it is interrupted + rmdir /var/run/network/mountnfs 2>/dev/null || exit 0 + } + trap on_exit EXIT # Enable emergency handler + do_start +elif [ yes = "$FROMINITD" ] ; then + do_start +fi -- cgit v1.2.3