Init
First look at several operating levels of Linux systems
# 0-Stop (do not set the Initdefault to 0, or the system will never start)
# 1-Single user mode
# 2-Multiuser, no NFS
# 3-Full multi-user mode (standard run level)
# 4– system Reserved
# 5-x11 (x Window)
# 6-Reboot (never set Initdefault to 6, otherwise it will be restarted)
#init 0 Switch to run level 0
The action is to run the following two scripts:
[[email protected] RC0.D] # pwd/etc/rc.d/rc0.d[[email protected] rc0.d]# ls-lrt s*lrwxrwxrwx. 1 root root: S01halt. /init.d/1 root root : S00killall, June. /init.d/killall
#init 6 Switch to run Level 6
The action is to run the following two scripts:
[[email protected] RC6.D] # pwd/etc/rc.d/rc6.d[[email protected] rc6.d]# ls-lrt s*lrwxrwxrwx. 1 root root: S01reboot. /init.d/1 root root : S00killall, June. /init.d/killall
Shutdown
Shutdown-bring the System Downshutdown [OPTION] ... Time [MESSAGE]-r requests that the system was rebooted after it had been brought down. -H requests that the system is either haltedorpowered off after it had been brought down, with the choice as to which left up to the system. -H requests that the system was halted after it had been brought down. -P requests that the system was powered off after it had been brought down. -C cancels a running shutdown. Time is notSpecified with this option, the first argument isMESSAGE. -K only send out the warning messages andDisable logins, do notActually bring the system down.
# shutdown-r equals reboot, which prompts a warning message to all logged-in users on the system before the system shuts down, and then calls Init 6 # shutdown-h equals halt it prompts a warning message to all logged-in users on the system before the system shuts down, and then calls Init 0 # shutdown-p equals Poweroff It prompts a warning message to all logged-in users on the system before the system shuts down, and then calls Init 0
Reboot,poweroff,halt
Reboot,poweroff,halt is actually a command, and the latter two are links to reboot
[[email protected] RC0.D] # ls-lrt/sbin/reboot-rwxr-xr-x. 1 root root 14832 March 2012/sbin/reboot[[email protected] rc0.d]#lrwxrwxrwx. 1 root root 6 June 2013/sbin/poweroff- reboot[[email protected] rc0.d]#lrwxrwxrwx. 1 root root 6 June 2013/sbin/halt-reboot
Reboot without the--force parameter is actually called the shutdown name, reboot direct shutdown with the--force parameter
Init shutdown reboot Poweroff halt differences