mountvirtfs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/sh
  2. # Begin $RC_BASE/init.d/mountvirtfs
  3. ### BEGIN INIT INFO
  4. # Provides: mountvirtfs
  5. # Required-Start:
  6. # Should-Start:
  7. # Required-Stop:
  8. # Should-Stop:
  9. # Default-Start: S
  10. # Default-Stop:
  11. # Short-Description: Mounts /sys, /proc, and /run virtual (kernel) filesystems.
  12. # Description: Mounts /sys, /proc, and run virtual (kernel) filesystems.
  13. # X-LFS-Provided-By: LFS
  14. ### END INIT INFO
  15. . /lib/lsb/init-functions
  16. case "${1}" in
  17. start)
  18. message="Mounting virtual file systems:"
  19. if ! mountpoint /proc > /dev/null; then
  20. message="${message}${INFO} /proc${NORMAL}"
  21. mount -n /proc || failed=1
  22. fi
  23. if ! mountpoint /sys > /dev/null; then
  24. message="${message}${INFO} /sys${NORMAL}"
  25. mount -n /sys || failed=1
  26. fi
  27. # create needed directories in /run
  28. mkdir /run/{var,lock,shm} || failed=1
  29. chmod 1777 /run/shm
  30. (exit ${failed})
  31. evaluate_retval standard
  32. ;;
  33. *)
  34. echo "Usage: ${0} {start}"
  35. exit 1
  36. ;;
  37. esac
  38. # End $RC_BASE/init.d/mountvirtfs