In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how to write the centos shutdown command". The content is simple and clear. I hope it can help you solve your doubts. Let the editor lead you to study and learn how to write the centos shutdown command.
Centos shutdown command: 1, "halt" command, can immediately shut down; 2, "poweroff" command, can immediately shut down; 3, "shutdown-h now" command, can immediately shut down; 4, "shutdown-h number" command, can specify automatic shutdown after minutes; 5, "init 0".
The operating environment of this tutorial: CentOS 6 system, Dell G3 computer.
Linux centos restart command:
Reboot
Shutdown-r now restart immediately (used by root users)
Shutdown-r 10 automatically restarts after 10 minutes (used by root users)
Shutdown-r restarts at 20:35 at 20:35 (used by root users)
If the restart is set up through the shutdown command, you can cancel the restart with the shutdown-c command
Linux centos shutdown command:
Halt shuts down immediately
Poweroff shuts down immediately
Shutdown-h now shuts down immediately (used by root users)
Shutdown-h shuts down automatically after 10 minutes.
Init 0 shutdown
If the shutdown is set by the shutdown command, you can cancel it with the shutdown-c command
1 、 shutdown
The shutdown command shuts down the system safely. Some users will turn off the linux by directly disconnecting the power supply, which is very dangerous. Because linux is different from windows, there are many processes running in the background, so forced shutdown may lead to data loss of processes, make the system in an unstable state, and even damage hardware devices in some systems.
Using the shutdown command before the system shuts down, the system administrator will inform all logged-in users that the system is going to shut down.
And the login instruction is frozen, meaning that new users can no longer log in. It is possible to shut down the phone directly or delay it for a certain amount of time. It could be rebooted. This is determined by the fact that all processes (process) receive a signal (signal) delivered by the system. This gives programs like vi time to store documents that are currently being edited, while programs like mail and news can leave normally, and so on.
Shutdown performs its job is to send a signal to the init program, asking it to change the runlevel.
Runlevel 0 is used to halt, and runlevel 6 is used to reactivate the system.
Runlevel 1, on the other hand, is used to put the system into a state where management can be done; this is preset, assuming that there is no-h and no-r parameter for shutdown. To find out what actions are taken during halt or reboot, you can see these runlevels-related materials in this file / etc/inittab.
Shutdown parameter description:
[- t] before changing to another runlevel, tell init how long it will take to shut down.
[- r] restart the calculator.
[- k] doesn't really turn it off, it just sends a warning signal to each login.
[- h] turn off the power supply (halt) after shutdown.
[- n] instead of init, turn off the phone yourself. The use of this option is discouraged, and the consequences of this option are not always what you expect.
[- c] cancel current process cancels the currently executing shutdown program. So of course there is no time parameter for this option, but you can enter a message for interpretation, and this information will be sent to each user.
[- f] ignore fsck when restarting the calculator (reboot).
[- F] forces fsck when restarting the calculator (reboot).
[- time] sets the time before shutdown (shutdown).
2. The simplest shutdown command for halt--
Halt is actually a call to shutdown-h. When halt executes, it kills the application process, executes the sync system call, and stops the kernel after the file system write operation is complete.
Parameter description:
[- n] prevents sync system calls, which are used after patching the root partition with fsck to prevent the kernel from overwriting the patched super block with an older version of the superblock.
[- w] is not really rebooting or shutting down, just writing wtmp (/ var/log/wtmp) records.
[- d] do not write wtmp records (already included in the option [- n]).
[- f] forced shutdown or restart without calling shutdown.
[- I] turn off all network interfaces before shutting down (or rebooting).
[- p] this option is the default. It is to call poweroff when the computer is turned off.
3 、 init
Init is the ancestor of all processes, and its process number is always 1, so sending TERM signals to init terminates all user processes, daemons, and so on. Shutdown uses this mechanism.
Init defines eight runlevels (runlevel), with init 0 as shutdown and init 1 as restart.
Init can be a long speech, so I won't talk about it here. There are also telinit commands that can change the running level of init, for example, telinit-iS allows the system to enter single-user mode without getting the information and wait time when using shutdown.
The above is all the contents of the article "how to write the centos shutdown command". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.