summaryrefslogtreecommitdiff
path: root/init.d
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-10-29 13:53:21 +0000
committerRoy Marples <roy@marples.name>2007-10-29 13:53:21 +0000
commite2ba92f77362097621c977e0e46d4c3e6a509c37 (patch)
treee7f247c6bf94055ca700a3b5b3c5be600e93f325 /init.d
parente372729b8cc489af7b1b2305d6fd9c1895b9c8d4 (diff)
downloadopenrc-e2ba92f77362097621c977e0e46d4c3e6a509c37.tar.gz
openrc-e2ba92f77362097621c977e0e46d4c3e6a509c37.tar.bz2
openrc-e2ba92f77362097621c977e0e46d4c3e6a509c37.tar.xz
/etc/mtab is now a true reflection on /proc/mounts. The only exception is that we punt any / on tmpfs entry, #194615.
Diffstat (limited to 'init.d')
-rwxr-xr-xinit.d/checkroot18
1 files changed, 5 insertions, 13 deletions
diff --git a/init.d/checkroot b/init.d/checkroot
index 959ca0b..eadb65c 100755
--- a/init.d/checkroot
+++ b/init.d/checkroot
@@ -13,19 +13,11 @@ do_mtab() {
fi
ebegin "Updating /etc/mtab"
- # Add the entry for / to mtab
- mount -f /
-
- # Don't list root more than once
- grep -v "^[^ ]* / " /proc/mounts >> /etc/mtab
-
- # Now make sure /etc/mtab have additional info (gid, etc) in there
- local mnt=
- mountinfo | while read mnt; do
- if fstabinfo --quiet "${mnt}"; then
- mount -f -o remount "${mnt}"
- fi
- done
+ # With / as tmpfs we cannot umount -at tmpfs in localmount as that
+ # makes / readonly and dismounts all tmpfs even if in use which is
+ # not good. Luckily, umount uses /etc/mtab instead of /proc/mounts
+ # which allows this hack to work.
+ grep -v "^[^ ]* / tmpfs" /proc/mounts > /etc/mtab
# Remove stale backups
rm -f /etc/mtab~ /etc/mtab~~