Copyright © tutorialspoint.com
| Tag | Description |
|---|---|
| -a | Use /etc/shutdown.allow. |
| -t sec | Tell init(8) to wait sec seconds between sending processes the warning and the kill signal, before changing to another runlevel. |
| -k | Dont really shutdown; only send the warning messages to everybody. |
| -r | Reboot after shutdown. |
| -h | Halt or poweroff after shutdown. |
| -H | Halt action is to halt or drop into boot monitor on systems that support it. |
| -P | Halt action is to turn off the power. |
| -n | [DEPRECATED] Dont call init(8) to do the shutdown but do it ourself. The use of this option is discouraged, and its results are not always what youd expect. |
| -f | Skip fsck on reboot. |
| -F | Force fsck on reboot. |
| -c | Cancel an already running shutdown. With this option it is of course not possible to give the time argument, but you can enter a explanatory message on the command line that will be sent to all users. |
| time | When to shutdown. |
| warning-message | Message to send to all users. |
If shutdown is called with a delay, it creates the advisory file /etc/nologin which causes programs such as login(1) to not allow new user logins. 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.
The -f flag means reboot fast. This only creates an advisory file /fastboot which can be tested by the system when it comes up again. The boot rc file can test if this file is present, and decide not to run fsck(1) since the system has been shut down in the proper way. After that, the boot process should remove /fastboot.
The -F flag means force fsck. This only creates an advisory file /forcefsck which can be tested by the system when it comes up again. The boot rc file can test if this file is present, and decide to run fsck(1) with a special force flag so that even properly unmounted filesystems get checked. After that, the boot process should remove /forcefsck.
The -n flag causes shutdown not to call init, but to kill all running processes itself. shutdown will then turn off quota, accounting, and swapping and unmount all filesystems.
shutdown: no authorized users logged in |
to the (physical) system console. The format of /etc/shutdown.allow is one user name per line. Empty lines and comment lines (prefixed by a #) are allowed. Currently there is a limit of 32 users in this file.
Note that if /etc/shutdown.allow is not present, the -a argument is ignored.
/fastboot /etc/inittab /etc/init.d/halt /etc/init.d/reboot /etc/shutdown.allow |
Init can only capture CTRL-ALT-DEL and start shutdown in console mode. If the system is running the X window System, the X server processes all key strokes. Some X11 environments make it possible to capture CTRL-ALT-DEL, but what exactly is done with that event depends on that environment.
Shutdown wasnt designed to be run setuid. /etc/shutdown.allow is not used to find out who is executing shutdown, it ONLY checks who is currently logged in on (one of the) console(s).
Copyright © tutorialspoint.com