summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. 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)
commit6d65109b402452e27dce3477ebf3d0ae21ffdc78 (patch)
treeb868b2cc6fc617e7439903578438ec72ec0efe9d
parentef1720e9f89afb1637edcefd4a79e0f44eb2ba48 (diff)
/etc/init.d/mountkernfs: Rewrite.
-rw-r--r--src.etc/init.d/mountkernfs26
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