/init/rc-sysinit.conf

http://github.com/brinkman83/bashrc · Config · 60 lines · 50 code · 10 blank · 0 comment · 0 complexity · bd0415c6387debecfff37a371b07002a MD5 · raw file

  1. # rc-sysinit - System V initialisation compatibility
  2. #
  3. # This task runs the old System V-style system initialisation scripts,
  4. # and enters the default runlevel when finished.
  5. description "System V initialisation compatibility"
  6. author "Scott James Remnant <scott@netsplit.com>"
  7. start on filesystem and net-device-up IFACE=lo
  8. stop on runlevel
  9. # Default runlevel, this may be overriden on the kernel command-line
  10. # or by faking an old /etc/inittab entry
  11. env DEFAULT_RUNLEVEL=2
  12. # There can be no previous runlevel here, but there might be old
  13. # information in /var/run/utmp that we pick up, and we don't want
  14. # that.
  15. #
  16. # These override that
  17. env RUNLEVEL=
  18. env PREVLEVEL=
  19. console output
  20. env INIT_VERBOSE
  21. task
  22. script
  23. # Check for default runlevel in /etc/inittab
  24. if [ -r /etc/inittab ]
  25. then
  26. eval "$(sed -nre 's/^[^#][^:]*:([0-6sS]):initdefault:.*/DEFAULT_RUNLEVEL="\1";/p' /etc/inittab || true)"
  27. fi
  28. # Check kernel command-line for typical arguments
  29. for ARG in $(cat /proc/cmdline)
  30. do
  31. case "${ARG}" in
  32. -b|emergency)
  33. # Emergency shell
  34. [ -n "${FROM_SINGLE_USER_MODE}" ] || sulogin
  35. ;;
  36. [0123456sS])
  37. # Override runlevel
  38. DEFAULT_RUNLEVEL="${ARG}"
  39. ;;
  40. -s|single)
  41. # Single user mode
  42. [ -n "${FROM_SINGLE_USER_MODE}" ] || DEFAULT_RUNLEVEL=S
  43. ;;
  44. esac
  45. done
  46. # Run the system initialisation scripts
  47. [ -n "${FROM_SINGLE_USER_MODE}" ] || /etc/init.d/rcS
  48. # Switch into the default runlevel
  49. telinit "${DEFAULT_RUNLEVEL}"
  50. end script