summaryrefslogtreecommitdiffstats
path: root/src.etc
diff options
context:
space:
mode:
Diffstat (limited to 'src.etc')
-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