Shutdown
(4 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | Used to shutdown a machine. [[shutdown]] requires two arguments: a command and a time. | + | Used to shutdown a machine. [[shutdown]] requires two arguments: a command and a time. By default, this command is only available to [[root]] and to the members of the '''operator''' group. |
==Common Flags and arguments== | ==Common Flags and arguments== | ||
Line 8: | Line 8: | ||
'''now''' is a valid keyword for the "time" argument. | '''now''' is a valid keyword for the "time" argument. | ||
+ | |||
+ | '''shutdown now''' prevent further logins, notify users of the impending (immediate) stop, halt most daemons, drop to [[single-user mode]]. | ||
'''shutdown -h now''' will halt the machine immediately - all users will be logged out forcefully, all pending writes will be performed, all disks sync'd, and the system will halt and wait for reboot. | '''shutdown -h now''' will halt the machine immediately - all users will be logged out forcefully, all pending writes will be performed, all disks sync'd, and the system will halt and wait for reboot. | ||
Line 13: | Line 15: | ||
'''shutdown -h +5''' will broadcast a console message to all currently logged in users warning them that the system will shutdown in 5 minutes, at which time it will forcefully log them out and do so. | '''shutdown -h +5''' will broadcast a console message to all currently logged in users warning them that the system will shutdown in 5 minutes, at which time it will forcefully log them out and do so. | ||
− | '''shutdown -r 0412310000''' will broadcast a console message warning users of a shutdown at midnight on New Year's Eve of 2004, and at that time will forcefully log them out, halt the system, and automatically reboot. | + | '''shutdown -r 0412310000''' will broadcast a console message warning users of a shutdown at midnight on New Year's Eve of 2004 (remember - that means 24 hours before 2005 arrives, not the minute the ball drops!), and at that time will forcefully log them out, halt the system, and automatically reboot. |
Compare to [[init]]. | Compare to [[init]]. | ||
[[Category:System Commands]] [[Category:Common Tasks]] | [[Category:System Commands]] [[Category:Common Tasks]] |
Latest revision as of 10:23, 1 May 2007
Used to shutdown a machine. shutdown requires two arguments: a command and a time. By default, this command is only available to root and to the members of the operator group.
[edit] Common Flags and arguments
-h will halt the machine -r will reboot the machine -p will turn the power off after shutdown (only works on some BIOSes) -k will send out a message that the machine will reboot, but not actually do it now is a valid keyword for the "time" argument.
shutdown now prevent further logins, notify users of the impending (immediate) stop, halt most daemons, drop to single-user mode.
shutdown -h now will halt the machine immediately - all users will be logged out forcefully, all pending writes will be performed, all disks sync'd, and the system will halt and wait for reboot.
shutdown -h +5 will broadcast a console message to all currently logged in users warning them that the system will shutdown in 5 minutes, at which time it will forcefully log them out and do so.
shutdown -r 0412310000 will broadcast a console message warning users of a shutdown at midnight on New Year's Eve of 2004 (remember - that means 24 hours before 2005 arrives, not the minute the ball drops!), and at that time will forcefully log them out, halt the system, and automatically reboot.
Compare to init.