unmount better

pull/5/head
Tomas M 2012-09-23 02:18:52 -05:00
parent cc9c11525e
commit fa4379fccd
1 changed files with 13 additions and 10 deletions

View File

@ -53,16 +53,19 @@ if [ "$1" = "--init" ]; then
mount -t proc proc /proc >/dev/console 2>&1 mount -t proc proc /proc >/dev/console 2>&1
# next, unmount everything # next, unmount everything
umount /memory/union/sys/fs/cgroup >/dev/console 2>&1 tac /proc/mounts | grep union | cut -d " " -f 2 | while read LINE; do
umount /memory/union/dev/pts >/dev/console 2>&1 umount $LINE
umount /memory/union/dev >/dev/console 2>&1 umount -l $LINE 2>/dev/null
umount /memory/union/run >/dev/console 2>&1 done
umount /memory/union/sys >/dev/console 2>&1
umount /memory/union/proc >/dev/console 2>&1 tac /proc/mounts | grep memory | cut -d " " -f 2 | while read LINE; do
umount /memory/union >/dev/console 2>&1 umount $LINE
umount /memory/bundles/* >/dev/console 2>&1 umount -l $LINE 2>/dev/null
umount /memory/data* >/dev/console 2>&1 done
mount -n -o remount,ro /memory/data >/dev/console 2>&1
# make sure the data directory is at least remounted read-only,
# if the previous unmount failed due to some busy err
mount -o remount,ro /memory/data 2>/dev/null
# if debug is requested, start commandline prompt here # if debug is requested, start commandline prompt here
if grep -vq debug /proc/cmdline; then if grep -vq debug /proc/cmdline; then