summaryrefslogtreecommitdiff
path: root/init.d
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-07-11 17:27:46 +0000
committerRoy Marples <roy@marples.name>2007-07-11 17:27:46 +0000
commit5257ba51b9524b101533308024862e4344c8b6f6 (patch)
tree71c5eab595f685a02f2ab2a8adfcac304406c4e4 /init.d
parente778dcbfb0ef9cb8101ac7e51c88c322f7ccbd22 (diff)
downloadopenrc-5257ba51b9524b101533308024862e4344c8b6f6.tar.gz
openrc-5257ba51b9524b101533308024862e4344c8b6f6.tar.bz2
openrc-5257ba51b9524b101533308024862e4344c8b6f6.tar.xz
Don't unmount network filesystems in localmount or halt.sh, #175602.
Diffstat (limited to 'init.d')
-rwxr-xr-xinit.d/halt.sh7
-rwxr-xr-xinit.d/localmount10
2 files changed, 14 insertions, 3 deletions
diff --git a/init.d/halt.sh b/init.d/halt.sh
index 1b4acca..dfcaced 100755
--- a/init.d/halt.sh
+++ b/init.d/halt.sh
@@ -65,7 +65,12 @@ if [ "${RC_UNAME}" = "Linux" ] ; then
# We need the do_unmount function
. "${RC_LIBDIR}"/sh/rc-mount.sh
eindent
- do_unmount "mount -n -o remount,ro" "^(/dev|/dev/pts|/dev/shm|/proc|/proc/.*|/sys)$"
+ fs=
+ for x in ${RC_NET_FS_LIST} ; do
+ fs="${fs}${fs:+|}${x}"
+ done
+ [ -n "${fs}" ] && fs="^(${fs})$"
+ do_unmount "mount -n -o remount,ro" "^(/dev|/dev/pts|/dev/shm|/proc|/proc/.*|/sys)$" "" "" "${fs}"
eoutdent
eend $?
unmounted=$?
diff --git a/init.d/localmount b/init.d/localmount
index bf12638..18d84a9 100755
--- a/init.d/localmount
+++ b/init.d/localmount
@@ -202,10 +202,16 @@ stop() {
do_unmount "umount -d" "${no_umounts}" "^/dev/loop"
eoutdent
- # Now everything else
+ # Now everything else, except network filesystems as the
+ # network should be down by this point.
einfo "Unmounting filesystems"
eindent
- do_unmount "umount" "${no_umounts}"
+ local fs=
+ for x in ${RC_NET_FS_LIST} ; do
+ fs="${fs}${fs:+|}${x}"
+ done
+ [ -n "${fs}" ] && fs="^(${fs})$"
+ do_unmount "umount" "${no_umounts}" "" "" "${fs}"
eoutdent
return 0