aboutsummaryrefslogtreecommitdiff
path: root/init.d/netmount
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-10-09 15:33:05 +0000
committerRoy Marples <roy@marples.name>2007-10-09 15:33:05 +0000
commitdc0ba7ebf3109b2bbdd73c5f0a411ba6129c2daf (patch)
tree2786be756e7ab35af0802eeea2f79820b2f4e7ff /init.d/netmount
parente89805e0c06792c58c19e47f99ab6379d69a2149 (diff)
netmount, localmount, halt.sh and net scripts now check OS specific flags to see if a mount is network mounted (linux = fstab, *bsd = "local" in mount options) or not, #192772.
Diffstat (limited to 'init.d/netmount')
-rwxr-xr-xinit.d/netmount40
1 files changed, 20 insertions, 20 deletions
diff --git a/init.d/netmount b/init.d/netmount
index 7ead6d9e..e4885a7c 100755
--- a/init.d/netmount
+++ b/init.d/netmount
@@ -21,7 +21,7 @@ depend() {
# Only have portmap as a dependency if there is a nfs mount in fstab that
# is set to mount at boot
local pmap=""
- if need_portmap ; then
+ if need_portmap; then
[ -x /etc/init.d/rpcbind ] \
&& pmap="rpcbind" \
|| pmap="portmap"
@@ -37,7 +37,7 @@ start() {
[ -x /etc/init.d/rpcbind ] && pmap="rpcbind"
local x= fs=
- for x in ${RC_NET_FS_LIST} ; do
+ for x in ${RC_NET_FS_LIST}; do
case "${x}" in
nfs|nfs4)
# If the nfsmount script took care of the nfs filesystems,
@@ -47,7 +47,7 @@ start() {
# Only try to mount NFS filesystems if portmap was started.
# This is to fix "hang" problems for new users who do not
# add portmap to the default runlevel.
- if need_portmap && ! service_started "${pmap}" ; then
+ if need_portmap && ! service_started "${pmap}"; then
continue
fi
;;
@@ -63,28 +63,28 @@ start() {
stop() {
local x= fs=
- for x in ${RC_NET_FS_LIST} ; do
- fs="${fs}${fs:+,}${x}"
- done
ebegin "Unmounting network filesystems"
- umount -at ${fs}
- local retval=$?
- eend ${retval} "Failed to simply unmount filesystems"
+ . "${RC_LIBDIR}/sh/rc-mount.sh"
- if [ ${retval} -ne 0 ] ; then
- . "${RC_LIBDIR}/sh/rc-mount.sh"
- eindent
- fs=
- for x in ${RC_NET_FS_LIST} ; do
- fs="${fs:+|}${x}"
- done
- do_unmount "umount" "" "" "^(${fs})$"
- retval=$?
- eoutdent
+ for x in ${RC_NET_FS_LIST} ; do
+ fs="${fs}${fs:+,}${x}"
+ done
+ if [ -n "${fs}" ]; then
+ umount -at ${fs} || eerror "Failed to simply unmount filesystems"
fi
- return ${retval}
+ eindent
+ fs=
+ for x in ${RC_NET_FS_LIST}; do
+ fs="${fs}${fs:+|}${x}"
+ done
+ [ -n "${fs}" ] && fs="^(${fs})$"
+ do_unmount "umount" ${fs:+--fstype-regex} ${fs} --netdev
+ retval=$?
+
+ eoutdent
+ eend ${retval} "Failed to unmount network filesystems"
}
# vim: set ts=4 :