summaryrefslogtreecommitdiffstats
path: root/src.etc/init.d/mountdevsubfs
diff options
context:
space:
mode:
Diffstat (limited to 'src.etc/init.d/mountdevsubfs')
-rw-r--r--src.etc/init.d/mountdevsubfs39
1 files changed, 39 insertions, 0 deletions
diff --git a/src.etc/init.d/mountdevsubfs b/src.etc/init.d/mountdevsubfs
new file mode 100644
index 0000000..14e82a3
--- /dev/null
+++ b/src.etc/init.d/mountdevsubfs
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+start()
+{
+ printf 'Mounting device file systems... '
+
+ [ -d /dev/pts ] || mkdir -m 0755 /dev/pts
+ if ! mount | grep -F ' /dev/pts ' >dev/null 2>&1; then
+ mount -t devpts -o noexec,nosuid,gid=5,mode=0620 devpts /dev/pts
+ fi
+
+ ln -sf /run/shm /dev/shm
+
+ printf 'done.\n'
+}
+
+stop()
+{
+ printf 'Unmounting device file systems... '
+
+ if mount | grep -F ' /dev/pts ' >dev/null 2>&1; then
+ umount /dev/pts
+ fi
+
+ printf 'done.\n'
+}
+
+case "${1}" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ *)
+ printf 'Usage: %s {start|stop}\n' "${0}" >&2
+ exit 1
+ ;;
+esac