UNIX switch command

Recommended for you: Get network issues from WhatsUp Gold. Not end users.


The shutdown command can be safely shutdown system. Some users will use the direct way to shut off the power supply of Linux,
This is very dangerous. Because Linux and windows are different, the running back many processes, so the forced shutdown may
Cause data loss, the system is in an unstable state, and even in some systems may damage the equipment.
While in shutdown of the system before using the shutdown command, the user system administrator will notify all logins will be closed.
And the login instruction will be frozen, namely the new user cannot log in again. Direct shutdown or delay some time before shutdown
It is possible, also may restart. This is by all processes (process) have received a signal system service〔signal〕
Decision. This lets like programs like VI have time to store currently editing the document, and image processing (mail) and mail
Press (News) program can be normal to leave.
Shutdown performs its job is to send the signal (signal) to the init program, asking it to change runlevel.
Runlevel 0 is used to stop (HALT), runlevel 6 is used to re activate (reboot) system﹐
While the runlevel 1 was used to make the system into the management of the state can be carried out; this is the default, assuming no -h
Without the -r parameter to shutdown. To understand the shutdown (HALT) or reboot (reboot) in the process of doing what
Action, you can see that the runlevels related information in the file /etc/inittab.
   The shutdown parameter specification:
   [-t] Before changing to other runlevel, told init how long after shutdown.
   [-r] Restart the computer.
   [-k] Don't shut down, just send warning signals to each login〔login〕.
   [-h] Shut down after the power off〔halt〕.
   [-n] Without init, but themselves to shutdown. Don't encourage the use of this option, the option and the consequences to the
To not always what you expect to get.
   [-c] Cancel current process to cancel shutdown procedures are currently performing. So the option of course not
The time parameter, but you can enter a used to interpret the message, and this information will be sent to each user.
   [-f] Ignore the fsck calculator (reboot) when the restart.
[-F] Forcing fsck calculator (reboot) when the restart.
   [-time] Set off (shutdown) before the time.

For example: shutdown -i S -g 120 system will shut down the system after 2mins
2.halt---- simple shutdown command
   In fact, halt is called shutdown -h. When halt is executed, kill the application process, implementation of sync system call﹐
File system write operation is completed will stop the kernel.
   Explanation of parameters:
   [-n] To prevent the sync system call, it used in the patch with the fsck root partition, to prevent the kernel with the old version of the super
Level (superblock) block covered patched super block.
   [-w] Not true to restart or shut down, just write wtmp (/var/log/wtmp) record.
   [-d] Has been included in the [-n] options do not write record (wtmp〕.
   [-f] Do not call shutdown and forced shutdown or restart.
   [-i] Shut down (or restart), turn off all of the network interface.
   [-p] This option is the default option. It is called poweroff shutdown.
The process of reboot almost like halt, but it is triggered reboot, and the halt is shut down. It
The parameters and halt is not much difference.
Init is all the processes of ancestors, its process number is always 1, so send the TERM signal to the init will stop all the
User process, the daemon. Shutdown is using this mechanism. Init defines 8 operation level(runlevel),
Init 0 init 1 for shutdown, restart. A init can be a long and minute statement, here no longer narratives. In addition to
Run level, the telinit command can change the init for example, telinit -iS can make the system into single user mode﹐
And not when using the shutdown information and waiting time.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Nat at December 24, 2013 - 10:23 PM