Centos command for shutdown and restart

Source: Internet
Author: User

Linux centos shutdown and restart commands
Linux centos restart command:
1. Reboot
2. shutdown-R now restarts immediately (used by the root user)
3. shutdown-r restarts automatically after 10 minutes (used by root users)
4. shutdown-r restart at (for root users)
If you use the shutdown command to set the restart, you can use the shutdown-C command to cancel the restart.
Linux centos shutdown command:
1. Shut down halt immediately
2. Power off immediately
3. shutdown-H now shut down immediately (used by the root user)
4. shutdown-H: shutdown automatically 10 minutes later
If you use the shutdown command to set shutdown, you can use the shutdown-C command to cancel the restart.
This is how the server is set up for the house network and Weihai real estate network!
1. Shutdown
The shutdown command safely shuts down the system. Some users disable Linux by directly disconnecting the power supply,
This is very dangerous. Different from windows, Linux runs many processes in the background, so force shutdown may
This may cause data loss in the process, make the system unstable, and even damage the hardware in some systems.
When the shutdown command is used before the system is shut down, the system administrator notifies all logged-on users that the system will be shut down.
The LOGIN command is frozen, meaning that new users cannot log on again. Shutdown directly or with a certain delay
Both are possible, and may restart. This is the signal that all processes will receive from the system [Signal 〕
. This allows programs such as VI to have time to store the files being edited, and processes emails such as [mail] and
News programs can leave normally.
Shutdown is to send a signal to the INIT program and ask it to change the runlevel.
Runlevel 0 is used to stop [halt] And runlevel 6 is used to reactivate the [reboot] system ﹐
Runlevel 1 is used to bring the system into the state where management can be performed. This is a preset. If-H is not used
No-R parameter is provided to shutdown. If you want to know what has been done during the shutdown (halt) or re-boot (reboot) Process
Actions: You can view the runlevels related information in the/etc/inittab file.
Shutdown parameter description:
[-T] before changing to another runlevel, tell init how long it will take to shut down.
[-R] restart the calculator.
[-K] does not actually shut down, but sends a warning signal to each consumer [Login 〕.
[-H] power off after Shutdown [halt 〕.
[-N] shut down by yourself instead of init. You are not encouraged to use this option, and the consequences of this option are always
Never always what you expected.
[-C] cancel current process cancels the currently running Shutdown program. So of course this option does not exist.
Time parameter, but you can enter a message for explanation, and this information will be sent to each user.
[-F] Ignore fsck when restarting calculator [reboot.
[-F] forces The fsck when restarting the calculator [reboot.
[-Time] set the time before shutdown.
2. Halt-the simplest shutdown command
In fact, halt calls shutdown-H. When halt is executed, the application process is killed and the sync system call is executed ﹐
After the file system writes, the kernel is stopped.
Parameter description:
[-N] prevents the sync system from calling. It is used to fix the root partition with fsck to prevent the kernel from using the earlier version
The level block (superblock) overwrites the repaired super block.
[-W] is not a real restart or shutdown, but a record for wtmp (/var/log/wtmp.
[-D] Do not write the wtmp record [included in Option [-N 〕.
[-F] Force shutdown or restart without calling shutdown.
[-I] disable all network interfaces before shutting down (or restarting.
[-P] this option is the default option. It is called poweroff when shutdown.
3. Reboot
The reboot process is similar to that of halt, but it causes host restart, while halt is shutdown. It
The parameters are similar to those of halt.
4. init
Init is the ancestor of all processes, and its Process number is always 1, so sending a term signal to init will terminate all
User process and daemon process. Shutdown uses this mechanism. Init defines eight runlevels ),
Init 0 is shutdown, and init 1 is restarted. I will not describe it here for a long article on init. In addition
The telinit command can change the running level of init. For example, telinit-Is can enable the system to enter the single-user mode ﹐
The shutdown information and waiting time are not available.
How to change the root administrator password in Linux
Log On As root (SSH Operation)
Enter the passwd command and you will be prompted to enter the new password.
The password cannot contain any characters.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.