diff options
author | P. J. McDermott <pjm@nac.net> | 2013-08-08 16:13:18 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2013-08-08 16:13:18 (EDT) |
commit | 6d65109b402452e27dce3477ebf3d0ae21ffdc78 (patch) | |
tree | b868b2cc6fc617e7439903578438ec72ec0efe9d | |
parent | ef1720e9f89afb1637edcefd4a79e0f44eb2ba48 (diff) |
/etc/init.d/mountkernfs: Rewrite.
-rw-r--r-- | src.etc/init.d/mountkernfs | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src.etc/init.d/mountkernfs b/src.etc/init.d/mountkernfs index e5e9508..8a701a8 100644 --- a/src.etc/init.d/mountkernfs +++ b/src.etc/init.d/mountkernfs @@ -1,17 +1,27 @@ #!/bin/sh +start() +{ + printf '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 + printf 'done.\n' +} + +stop() +{ + printf 'Unmounting kernel virtual file systems... ' + [ -e /proc/mounts ] && umount /proc + [ -e /sys/kernel ] && umount /sys + printf 'done.\n' +} + case "${1}" in start) - printf 'Mounting process and system filesystems... ' - [ ! -e /proc/mounts ] && mount -t proc proc /proc - [ ! -e /sys/kernel ] && mount -t sysfs sysfs /sys - printf 'done.\n' + start ;; stop) - printf 'Unmounting process and system filesystems... ' - [ -e /proc/mounts ] && umount /proc - [ -e /sys/kernel ] && umount /sys - printf 'done.\n' + stop ;; *) printf 'Usage: %s {start|stop}\n' "${0}" >&2 |