aboutsummaryrefslogtreecommitdiff
path: root/init.d
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2015-10-14 10:41:14 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2015-10-14 12:19:13 -0500
commitb29b2fb3cb3e73b4453483ced908f0ef10e47e9c (patch)
treedafe1c0efd16c1d230ab6a8be5466f0fae930c50 /init.d
parent7da72ce487a8d92d992e7fd3db881c198ae02609 (diff)
mtab: make /etc/mtab as a file configurable
Diffstat (limited to 'init.d')
-rw-r--r--init.d/mtab.in15
1 files changed, 8 insertions, 7 deletions
diff --git a/init.d/mtab.in b/init.d/mtab.in
index 1442ffd6..4deaba61 100644
--- a/init.d/mtab.in
+++ b/init.d/mtab.in
@@ -14,16 +14,17 @@ start()
{
local rc=0
ebegin "Updating /etc/mtab"
- if [ -L /etc/mtab ] ; then
- ewarn "/etc/mtab is a symlink, not updating."
- ewarn "FYI - You can safely remove mtab from your runlevels."
- elif ! checkpath -W /etc; then
+ if ! checkpath -W /etc; then
rc=1
- elif [ ! -e /etc/mtab ]; then
- einfo "Creating mtab symlink"
+ elif ! yesno ${mtab_is_file:-no}; then
+ [ ! -L /etc/mtab ] && [ -f /etc/mtab] &&
+ ewarn "Removing /etc/mtab file"
+ einfo "Creating mtab symbolic link"
ln -snf /proc/self/mounts /etc/mtab
else
- einfo "Updating mtab file"
+ [ -L /etc/mtab ] && ewarn "Removing /etc/mtab symbolic link"
+ rm -f /etc/mtab
+ einfo "Creating mtab file"
# 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