From 6d65109b402452e27dce3477ebf3d0ae21ffdc78 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Thu, 08 Aug 2013 16:13:18 -0400 Subject: /etc/init.d/mountkernfs: Rewrite. --- (limited to 'src.etc') 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 -- cgit v0.9.1