From b83108cd2e44bd20840295d595160c6354ed4256 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 9 Jul 2008 16:08:38 +0000 Subject: Add a knob to avoid the unmounting of some points. --- init.d/halt.sh.in | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'init.d/halt.sh.in') diff --git a/init.d/halt.sh.in b/init.d/halt.sh.in index 7b6f55c4..8431b1cb 100644 --- a/init.d/halt.sh.in +++ b/init.d/halt.sh.in @@ -4,6 +4,7 @@ . @SYSCONFDIR@/init.d/functions.sh . "${RC_LIBDIR}"/sh/rc-functions.sh +[ -r @SYSCONFDIR@/conf.d/localmount ] && . @SYSCONFDIR@/conf.d/localmount [ -r @SYSCONFDIR@/rc.conf ] && . @SYSCONFDIR@/rc.conf # Support LiveCD foo @@ -79,6 +80,20 @@ if [ "${RC_UNAME}" = "Linux" ]; then # We need the do_unmount function . "${RC_LIBDIR}"/sh/rc-mount.sh eindent + no_umounts_r="/|/dev|/dev/.*|${RC_SVCDIR}" + # RC_NO_UMOUNTS is an env var that can be set by plugins + OIFS=${IFS} SIFS=${IFS-y} + IFS=$IFS: + for x in ${no_umounts} ${RC_NO_UMOUNTS}; do + no_umounts_r="${no_umounts_r}|${x}" + done + if [ "${SIFS}" = "y" ]; then + IFS=$OIFS + else + unset IFS + fi + no_umounts_r="${no_umounts_r}|/proc|/proc/.*|/sys|/sys/.*" + no_umounts_r="^(${no_umounts})$" fs= for x in ${net_fs_list}; do fs="${fs}${fs:+|}${x}" @@ -86,7 +101,6 @@ if [ "${RC_UNAME}" = "Linux" ]; then [ -n "${fs}" ] && fs="^(${fs})$" do_unmount "mount -n -o remount,ro" \ --skip-point-regex "^(/dev|/dev/.*|/proc|/proc/.*|/sys|/sys/.*)$" \ - --skip-options-regex "^ro" \ ${fs:+--skip-fstype-regex} ${fs} --nonetdev eoutdent eend $? -- cgit v1.2.3