diff options
author | P. J. McDermott <pj@pehjota.net> | 2014-06-03 16:01:00 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2014-06-03 16:01:00 (EDT) |
commit | 60f11bd06935483eaa618b5e4ff53e7b0ec0d80a (patch) | |
tree | ee321f6ebdc4766e14860cac59638c96c6a1022e /src.etc/init.d/mountkernfs | |
parent | 06d7b2b5f5fda27c2f5f94e953fd9afe6c643e22 (diff) |
/etc/init.d/mountkernfs: Make more robust.
Diffstat (limited to 'src.etc/init.d/mountkernfs')
-rwxr-xr-x | src.etc/init.d/mountkernfs | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src.etc/init.d/mountkernfs b/src.etc/init.d/mountkernfs index 108a550..83d5179 100755 --- a/src.etc/init.d/mountkernfs +++ b/src.etc/init.d/mountkernfs @@ -3,15 +3,23 @@ start() { log 'Mounting kernel virtual file systems' - [ ! -e /proc/mounts ] && mount -t proc -o nodev,noexec,nosuid \ - proc /proc - [ ! -e /sys/kernel ] && mount -t sysfs -o nodev,noexec,nosuid \ - sysfs /sys + if ! [ -e /proc/mounts ]; then + mount -t proc -o nodev,noexec,nosuid proc /proc || \ + return ${?} + fi + if ! [ -e /sys/kernel ]; then + mount -t sysfs -o nodev,noexec,nosuid sysfs /sys || \ + return ${?} + fi } stop() { log 'Unmounting kernel virtual file systems' - [ -e /proc/mounts ] && umount /proc - [ -e /sys/kernel ] && umount /sys + if [ -e /proc/mounts ]; then + umount /proc || return ${?} + fi + if [ -e /sys/kernel ]; then + umount /sys || return ${?} + fi } |