In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about what the immediate shutdown command is in linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
What is Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.
Linux immediate shutdown command: 1, "shutdown-h now" command, root users use; 2, "halt" command; 3, "poweroff" command, the effect is equivalent to the "shutdown-h now" command, is not recommended in multi-user mode.
The operating environment of this tutorial: Red Hat Enterprise Linux 6.1 system, Dell G3 computer.
Shutdown command:
1. Shutdown-h now shuts down immediately (used by root users)
2. Halt shuts down immediately
3. Poweroff shuts down immediately
If the shutdown is set through the shutdown command, you can cancel the restart with the shutdown-c command
Command introduction
Some commonly used shutdown / restart commands under linux are shutdown, halt, reboot, and init, which can restart the system, but the internal working process of each command is different. Through the introduction of this article, I hope you can use various shutdown commands more flexibly.
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, and it is also possible to restart it. 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, runlevel 6 is used to reactivate the system, and runlevel 1 is used to put the system into a state where administrative work can be done; this is preset, assuming that there is no-h and no-r parameter to 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. HaltMustWhile-the simplest shutdown command
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.poweroff command
Poweroff means shutdown immediately, which is equivalent to shutdown-h now and is not recommended in multi-user mode (Run Level 3).
Thank you for reading! This is the end of the article on "what is the immediate shutdown command in linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
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.