Linux centos Restart command ：
1、reboot Normal restart
2、shutdown -r now Restart now (root The user to use )
3、shutdown -r 10 too 10 Minutes automatic restart (root The user to use )
4、shutdown -r 20:35 In time for 20:35 Time to restart (root The user to use )
If it's through shutdown If the command is set to restart , It can be used shutdown -c Command to cancel restart
Linux centos Shutdown command ：
1、halt Turn off immediately.
2、poweroff Turn off immediately.
3、shutdown -h now Turn off immediately. (root The user to use )
4、shutdown -h 10 10 Turn off automatically in minutes
If it's through shutdown Command settings to shut down , It can be used shutdown -c Command to cancel restart
Ask real estate network and Weihai real estate network server is set like this ！
shutdown Command to shut down the system safely . Some users will turn off the power supply directly linux,
It's very dangerous . because linux And windows Different , There are many processes running in the background , So a forced shutdown might
Can cause data loss of the process ﹐ Make the system unstable ﹐ Even in some systems, the hardware will be damaged .
And use it before the system is shut down shutdown command ﹐ The system administrator will notify all logged in users that the system will shut down .
also login The command will be frozen ﹐ That is, new users can no longer log in . Shut down directly or delay for a certain time
It's all possible ﹐ It could also restart . It's by all processes 〔process〕 Will receive the signal from the system 〔signal〕
Decisive . It's like vi Programs like this have time to store documents that are currently being edited ﹐ And it's like dealing with mail 〔mail〕 and
Journalism 〔news〕 And so on .
shutdown Its job is to signal 〔signal〕 to init Program ﹐ Ask it to change runlevel.
Runlevel 0 Used to shut down 〔halt〕﹐runlevel 6 It's used to reactivate 〔reboot〕 System ﹐
and runlevel 1 It is used to make the system into a state where management can be carried out ﹔ It's supposed to be ﹐ Suppose not -h also
No, -r Parameters to shutdown. To understand what's going on 〔halt〕 Or restart it 〔reboot〕 What was done in the process
action ﹐ You can find it in this file /etc/inittab I see this in the library runlevels Relevant information .
shutdown Parameter description :
[-t] It's changing to something else runlevel Before ﹐ tell init How long will it be shut down .
[-r] Restart the calculator .
[-k] It doesn't really shut down ﹐ Just send a warning signal to every login 〔login〕.
[-h] Turn off the power after shutting down 〔halt〕.
[-n] no need init﹐ It's turning it off by yourself . This option is not encouraged ﹐ And the consequences of this option are
It's not always what you expect .
[-c] cancel current process Cancel the shutdown program currently in progress . So of course there is no such option
Time parameters ﹐ But you can enter a message to explain ﹐ And this information will be sent to every user .
[-f] Restart the calculator 〔reboot〕 Ignore fsck.
[-F] Restart the calculator 〔reboot〕 When forced fsck.
[-time] Set shutdown 〔shutdown〕 Time before .
2.halt—- The simplest shutdown command
Actually halt It's called shutdown -h.halt Execution time ﹐ Kill the application process ﹐ perform sync system call ﹐
The kernel will stop after the file system write operation .
Parameter description :
[-n] prevent sync system call ﹐ It's used for fsck After patching the root partition ﹐ To prevent the kernel from using the older version of the super
Stage block 〔superblock〕 Covering patched superblocks .
[-w] It's not really a reboot or shutdown ﹐ Just write wtmp〔/var/log/wtmp〕 Record .
[-d] Don't write wtmp Record 〔 Included in option [-n] in 〕.
[-f] There is no call shutdown And force a shutdown or restart .
[-i] To turn it off 〔 Or restart 〕 front ﹐ Turn off all network interfaces .
[-p] This option is the default . It is called when shutting down poweroff.
reboot It's almost like halt equally ﹐ But it causes the host to restart ﹐ and halt It's shut down . it
The parameters of halt There is not much difference .
init Is the ancestor of all processes ﹐ Its process number is always 1﹐ So send TERM Signal to init Will terminate all
User process ﹑ Daemons, etc .shutdown That's how it works .init Defined 8 Operating levels (runlevel),
init 0 To shut down ﹐init 1 For restart . About init It can be long ﹐ This is no longer about . And then there is
telinit Orders can change init Operation level of ﹐ such as ﹐telinit -iS The system can be put into single user mode ﹐
And it's not used shutdown The information and waiting time of the system .
linux How to modify root Administrator password
With root Identity login (SSH operation )
Input passwd command You will be prompted to enter a new password
You can't see the characters when you enter the password .