diff options
-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 } |