|Mac OS version||Windows|
nowor at another
/sbin/shutdown [-t sec] [-arkhncfFHP]
messageand logins are disabled.
SIGTERM. This gives programs like editors the time to save the file being edited, other programs a chance to exit cleanly
SIGKILLto all processes
-ris given to shutdown
/etc/inittabdefines the action is taken for halt or reboot.
The time argument can be of the form:
message sent to all users.
/etc/nologin is created if
shutdown is called with a delay.
This causes programs such as
login to deny logins.
Shutdown removes this file if it is stopped before it signals
init (i.e. it is cancelled or something goes wrong).
/etc/nologin before calling
init to change the runlevel.
CTRL-ALT-DELare pressed, by creating an appropriate entry in
/etc/inittab. This means that everyone who has physical access to the console keyboard can shut the system down. Shutdown can check to see if an authorized user is logged in on one of the virtual consoles. If shutdown is called with
-a(add this to the invocation of shutdown in
/etc/inittab), it checks to see if the file
/etc/shutdown.allowis present. It then compares the login names in that file with the list of people that are logged in on a virtual console (from
/var/run/utmp). Only if one of those authorized users or root is logged in, it will proceed. Otherwise it will write the message to the (physical) system console.
The format of
shutdown: no authorized users logged in
/etc/shutdown.allowis one user name per line. Empty lines and comment lines (prefixed by a #) are allowed. There is a limit of 32 users in this file.
Note that if
/etc/shutdown.allow is not present, the
-a is ignored.
-Hoption just sets the init environment variable
HALT, and the
-Pjust sets that variable to
POWEROFF. The shutdown script that calls halt as the last thing in the shutdown sequence should check these environment variables and call halt with the right options for these options to actually have any effect. Debian 3.1 (sarge) supports this.
time argument is mandatory
[CTRL]-[ALT]-[DEL] will start
shutdown from a console
in text mode.
If the console is running a window System, the windows server processes key strokes and processing of
[CTRL]-[ALT]-[DEL] is server dependent.
Shutdown wasn't designed to be run setuid.
/etc/shutdown.allow does not chwck who invoked shutdown, ONLY who is logged in on (one of) the console(s).
-n If -o is specified, prevent the file system cache from being flushed by passing -n option to halt or reboot. This option should not be used.
*** System shutdown message from firstname.lastname@example.orgName ***
Starting at no more than 10 hours before shutdown, at intervals becoming more frequent
5 minutes before shutdown, or immediately if shutdown is in less than 5 minutes,
A scheduled shutdown can be canceled by reporting
SEE ALSO kill(1), login(1), wall(1), nologin(5), halt(8), init(8), reboot(8)
shutdown [/i ]
Reasons Expected Unexpected Planned, Type Major Minor Title EU 0 0 Other E P U 0 5 Other Failure: System Unresponsive E P 1 1 Hardware: Maintenance (Unplanned) E P 1 2 Hardware: Installation E P 2 2 Operating System: Recovery P 2 3 Operating System: Upgrade E P 2 4 Operating System: Reconfiguration P 2 16 Operating System: Service pack P 2 17 Operating System: Hot fix P 2 18 Operating System: Security fix E P 4 1 Application: Maintenance E P 4 2 Application: Installation E 4 5 Application: Unresponsive E 4 6 Application: Unstable U 5 15 System Failure: Stop error EUP 5 19 Security issue E 5 20 Loss of network connectivity (Unplanned) U 6 11 Power Failure: power loss U 6 12 Power Failure: Environment P 7 0 Legacy API shutdown
/sbin/halt [-n] [-w] [-d] [-f] [-i] [-p] [-h]
/sbin/reboot [-n] [-w] [-d] [-f] [-i]
/sbin/poweroff [-n] [-w] [-d] [-f] [-i] [-h]
haltnotes that the system is being brought down in the file
/var/log/wtmp, and then either tells the kernel to halt, reboot or power-off the system. If halt or reboot is called when the system is in normal multi user mode (not in runlevel 0 or 6), shutdown will be invoked instead (with -h or -r ). The rest of this manpage describes the behaviour in runlevels 0 and 6, that is when the systems shutdown scripts are being run. -d Don't write the wtmp record. -w write the wtmp record (in the /var/log/wtmp file). Don't reboot or halt -n Don't sync before reboot or halt. Note that the kernel and storage drivers may still sync. implies -d. -f Force halt or reboot, don't call shutdown(8). -i interfaces for networks are shutdown just before halt or reboot. -h hard drives put in stand-by mode just before halt or power-off. -p poweroff When halting the system halt and reboot invoke shutdown(8) if the system is not in runlevel 0 or 6. This means that if halt or reboot cannot find out the current runlevel (for example, when /var/run/utmp hasn't been initialized correctly) shutdown will be called, which might not be what you want. Use the -f flag if you want to do a hard halt or reboot. The -h flag puts all hard disks in standby mode just before halt or power-off. causing the write cache on the disk to be flushed. This is important for IDE drives, since the kernel doesn't flush the write cache itself before power-off. The halt program uses /proc/ide/hd* to find all IDE disk devices, which means that /proc needs to be mounted when halt or poweroff is called or the -h switch will do nothing. shutdown - bring the system down /sbin/shutdown [-akrhPHfFnc] [-t sec] time [warning message] shutdown brings the system down in a secure way. All logged-in users are notified that the system is going down, and login(1) is blocked. It is possible to shut the system down immediately or after a specified delay. All processes are first notified that the system is going down by the signal SIGTERM. This gives programs like vi(1) the time to save the file being edited, mail and news processing pro- grams a chance to exit cleanly, etc. shutdown does its job by signalling the init process, asking it to change the runlevel. Runlevel 0 is used to halt the system, runlevel 6 is used to reboot the system, and runlevel 1 is used to put to system into a state where administrative tasks can be performed; this is the default if neither the -h or -r flag is given to shutdown. To see which actions are taken on halt or reboot see the appropriate entries for these runlevels in the file /etc/inittab. The time argument can have different formats.
nowis an alias for +0.
/etc/nologinwhich causes programs such as login(1) to not allow new user logins. This file is created five minutes before the shutdown sequence starts. Shutdown removes this file if it is stopped before it can signal init (i.e. it is cancelled or something goes wrong). It also removes it before calling init to change the runlevel.