#! /bin/sh ### BEGIN INIT INFO # Provides: mountdevsubfs # Required-Start: mountkernfs # Required-Stop: # Should-Start: udev # Default-Start: S # Default-Stop: # Short-Description: Mount special file systems under /dev. # Description: Mount the virtual filesystems the kernel provides # that ordinarily live under the /dev filesystem. ### END INIT INFO # # This script gets called multiple times during boot # setglobal PATH = '/sbin:/bin' setglobal TTYGRP = '5' setglobal TTYMODE = '620' test -f /etc/default/devpts && source /etc/default/devpts setglobal KERNEL = $[uname -s] source /lib/lsb/init-functions source /lib/init/vars.sh source /lib/init/tmpfs.sh source /lib/init/mount-functions.sh # May be run several times, so must be idempotent. # $1: Mount mode, to allow for remounting proc mount_filesystems { setglobal MNTMODE = $1 # Mount a tmpfs on /run/shm mount_shm $MNTMODE # Mount /dev/pts if test $KERNEL = Linux { if test ! -d /dev/pts { mkdir --mode=755 /dev/pts test -x /sbin/restorecon && /sbin/restorecon /dev/pts } domount $MNTMODE devpts "" /dev/pts devpts "-onoexec,nosuid,gid=$TTYGRP,mode=$TTYMODE" } } match $1 { with "" echo "Warning: mountdevsubfs should be called with the 'start' argument." > !2 mount_filesystems mount_noupdate with start mount_filesystems mount_noupdate with restart|reload|force-reload mount_filesystems remount with stop|status # No-op with * echo "Usage: mountdevsubfs [start|stop]" > !2 exit 3 }