diff --git a/init.d/localmount.in b/init.d/localmount.in index 8e67c38a..ab0b1b5c 100644 --- a/init.d/localmount.in +++ b/init.d/localmount.in @@ -22,6 +22,9 @@ start() if [ "$RC_UNAME" = Linux ]; then no_netdev="-O no_netdev" + if [ mountinfo -q /usr ]; then + touch $rc_svcdir/usr_premounted + fi fi ebegin "Mounting local filesystems" mount -at "$types" $no_netdev @@ -48,7 +51,10 @@ stop() done if [ "$RC_UNAME" = Linux ]; then - no_umounts_r="$no_umounts_r|/proc|/proc/.*|/run|/sys|/sys/.*|/usr" + no_umounts_r="$no_umounts_r|/proc|/proc/.*|/run|/sys|/sys/.*" + if [ -e $rc_svcdir/usr_premounted ]; then + no_umounts_r="$no_umounts_r|/usr" + fi fi no_umounts_r="^($no_umounts_r)$"