Linux Restart command and how do I restart the network?

Source: Internet
Author: User

Sharing the use of the Linux Restart command, how does Linux restart the network?

The first part, about the use of the Linux restart command

1, shutdown
2, Poweroff
3. Init
4, reboot
5, halt

*---Specific instructions---

Shutdown
Reboot
Some common shutdown commands and restart commands under Linux are shutdown, halt, reboot, and Init, all of which can be used to reboot the system, but each command's internal
The work process is different, through the introduction of this article, I hope you can more flexible use of various shutdown commands.
1.shutdown
Shutdown command to safely shut down the system. It is dangerous for some users to turn Linux off using a direct power-off. Because Linux, unlike Windows, runs many processes in the background, forcing a shutdown can cause data loss to the process, leave the system in an unstable state, or even damage the hardware device in some systems. With the shutdown command before the system shuts down, the system administrator notifies all logged-on users that the system will be closed. And the login command is frozen, that is, the new user can no longer log in. It is possible to shut down directly or delay a certain amount of time before shutting down, and it may be possible to restart the computer. This is the signal that the system will receive from all processes (process)
(signal)
Decision-making. This allows programs like VI to have time to store documents that are currently being edited, rather like processing mail (mail) and
The program of news (news) can leave normally and so on.
Shutdown performs its job of sending a signal (signal) to the INIT program, requiring it to change the runlevel.
Runlevel 0 is used to shut down (halt),runlevel 6 is used to reactivate the (reboot) system,
The RunLevel 1 is used to allow the system to enter the state of the management work, which is preset, assuming that there is no-H and no-R parameter to shutdown. To understand the downtime
You can see these runlevels related data in this file/etc/inittab when (halt) or rebooting the (reboot) process.
Shutdown parameter Description:
[-T] tell Init how long it will shut down before changing to another runlevel.
[-R] Restart calculator.
[-K] does not really shut down, just send a warning signal to
(login) per log-in person.
[-h] turn off the power (halt) after shutting down the machine.
[-n] do not use init, but to shut down the machine. The use of this option is discouraged, and the consequences of this option are often not always what you expect it to be.
[-c] Cancel current process cancels the shutdown program that is currently executing. So this option certainly doesn't have a time parameter, but you can enter a message to interpret it.
, and this information will be sent to each user.
[-f] ignores fsck when restarting the calculator (reboot).
[-f] forces fsck to restart the calculator (reboot).
[-time] Sets the time before the shutdown (shutdown).
     
2.halt----The simplest shutdown command
In fact, halt is called shutdown-h. When the halt executes, the application process is killed, the sync system is called, and the kernel is stopped after the file system write operation is complete.
Parameter description:
[-n] prevents the sync system from being called, it is used after patching the root partition with fsck to prevent the kernel from overwriting the patched super block with the old version of the Super Block (superblock).
[-W] is not a real reboot or shutdown, just write
Wtmp(/var/log/wtmp) record. Linux shutdown command
[-d] does not write wtmp record (included in option [-n]).
[-f] does not invoke shutdown and forces shutdown or restart.
[-i] before shutting down (or restarting), turn off all network interfaces.
[-p] This option is the default option. is to call Poweroff when shutting down the machine.
  
3.reboot
Reboot works almost like halt, but it triggers a host reboot, and Halt is shut down. Its parameters are not much different from the halt.
4.init
Init is the ancestor of all processes, and its process number is always 1, so sending a term signal to init terminates all user processes ﹑ daemons and so on. Shutdown is the use of this mechanism. Init defines 8 runlevel (runlevel) and init 0 shuts down,init 1 for reboot. There is no longer a narrative about Init, which can be lengthy. There are also telinit commands that can change the runlevel of Init, such as,telinit-is, which allows the system to enter single-user mode, and does not get information and wait time when using shutdown.

How Linux Restarts the network
After modifying the network settings under Linux does not need to restart the computer, only need to restart the relevant settings options, network settings modified (such as the replacement of IP, domain, etc.): if it is redhat, restart the network can be entered service network restart or/etc/rc.d/ Init.d/network restart.

In the case of SuSE, there are three ways to restart the network:

1. Service Network restart

2, Rcnetwork restart

3,/etc/rc.d/network restart

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.