home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / etc / init.d / mountdevsubfs.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2006-08-23  |  1.2 KB  |  60 lines

  1. #! /bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:          mountdevsubfs mountvirtfs
  4. # Required-Start:    mountkernfs
  5. # Required-Stop:
  6. # Default-Start:     S
  7. # Default-Stop:
  8. # Short-Description: Mount special file systems under /dev.
  9. # Description:       Mount the virtual filesystems the kernel provides
  10. #                    that ordinarily live under the /dev filesystem.
  11. ### END INIT INFO
  12.  
  13. PATH=/lib/init:/sbin:/bin
  14. TTYGRP=5
  15. TTYMODE=620
  16. [ -f /etc/default/devpts ] && . /etc/default/devpts
  17.  
  18. TMPFS_SIZE=
  19. [ -f /etc/default/tmpfs ] && . /etc/default/tmpfs
  20.  
  21. KERNEL="$(uname -s)"
  22.  
  23. . /lib/lsb/init-functions
  24. . /lib/init/mount-functions.sh
  25.  
  26. do_start () {
  27.     #
  28.     # Mount a tmpfs on /dev/shm
  29.     #
  30.     SHM_OPT=
  31.     [ "${SHM_SIZE:=$TMPFS_SIZE}" ] && SHM_OPT="-osize=$SHM_SIZE"
  32.     domount tmpfs shmfs /dev/shm $SHM_OPT
  33.  
  34.     #
  35.     # Mount /dev/pts. Create master ptmx node if needed.
  36.     #
  37.     domount devpts "" /dev/pts -ogid=$TTYGRP,mode=$TTYMODE
  38. }
  39.  
  40. case "$1" in
  41.   "")
  42.     echo "Warning: mountdevsubfs should be called with the 'start' argument." >&2
  43.     do_start
  44.     ;;
  45.   start)
  46.     do_start
  47.     ;;
  48.   restart|reload|force-reload)
  49.     echo "Error: argument '$1' not supported" >&2
  50.     exit 3
  51.     ;;
  52.   stop)
  53.     # No-op
  54.     ;;
  55.   *)
  56.     echo "Usage: mountdevsubfs [start|stop]" >&2
  57.     exit 3
  58.     ;;
  59. esac
  60.