There are shutdown, halt, reboot, and Init in the Linux Shimonoseki and reboot system, for whom their internal working process is different.
1. Shutdown command
It can be used to safely shut down the system, but when the system is shut down, all logged-in users will be notified that the system will be closed and all instructions will be frozen, that is, all new users will not be able to log in again, and that the instruction may be shut down or restarted immediately and delayed for a period of time. (Note: Only Superuser can use this command)
Command syntax format:
shutdown [options] [TIME] [warning message]
The meaning of each of the options in this command is explained:
-K: Just send a warning message to the user
-R: Rebooting the system after shutting down the system
-H: Do not restart the system after shutting down the system
-F: Quickly shuts down the system, but does not perform disk detection when rebooting the system (discovering that the system entered the BIOS interface during the experiment, but cannot do anything)
-N: Close the system quickly, but not through the INIT program
-C: Interrupt shutdown system (no specific test found)
2. Halt command
Using the halt command is to invoke the "shutdown-h" command to execute the shutdown system
command syntax format;
Halt [Options]
-W: Not really shut down the system, just write "wtmp" (/var/log/wtmp) record
-D: Do not write "wtmp"
-F: "Shutdown" is not called but forced to close
-I: Turn off all network UO interfaces before shutting down the system or rebooting the system
-P: This option is the default option to invoke "power off" when shutting down the system
3. Reboot command
The reboot command works in a similar way to the halt command, but reboot initiates a host restart. All of its parameters are similar to "halt".
4. Init command
The init command uses the system's operating level control system. It is the ancestor of all system processes, its process number is always 1, so send "term" signal to INIT will terminate all user processes and daemons, etc., "shutdown" is the use of this mechanism. Init 0 is the shutdown system, init 1 restarts the system.