Linux Basics-Switch Management

        The linux operating system is mostly used on servers, and it is rare to encounter shutdown operations. Shut down unless necessary.

        The correct shutdown process is: sync (synchronize data from memory to hard disk) > shutdown > reboot > halt

        The shutdown command is: shutdown, and you can also view the help documentation through the man shutdown command.

        Use the shutdown command to shut down the system, and the system administrator will notify all logged-in users that the system will be shut down. And the login command will be frozen, that is, new users can no longer log in. It is possible to shut down directly or delay the shutdown for a certain period of time, and it is also possible to restart the system. This is determined by the fact that all processes [process] will receive the signal [signal] delivered by the system. This allows programs like [vi, vim] time to save the document currently being edited. And programs like mail [mail] and news [news] can leave normally and so on. The job of shutdown is to pass the signal [signal] to the init program, asking it to change the operating level of the system [runlevel].

        

System V init runlevel

systemd target name

systemd target role

0

poweroff.target

shutdown

1

rescue.target

single user mode

2

multi-user.target

multi-user text interface

3

multi-user.target

multi-user text interface

4

multi-user.target

multi-user text interface

5

graphical.target

multi-user GUI

6

reboot.target

reboot

emergency

emergency.target

rescue mode

reboot  restart now
init 0 shut down immediately
halt shut down immediately
poweroff shut down immediately
shutdown –h now Immediate shutdown (scheduled shutdown)
shutdown –h 2:00 Shutdown at 2:00 today (scheduled shutdown)
shutdown –h +10 Shut down after 10 minutes (scheduled shutdown)
shutdown –r now Immediate restart (scheduled restart)
shutdown –r +10 Automatic restart after 10 minutes (timed restart)
shutdown -c cancel reboot

Guess you like

Origin blog.csdn.net/shangyuanzhai/article/details/130360388