Thursday, July 27, 2006

Some Oddities of Shutdown

Some shutdown odditiesshutdown can be run in terminal or on a console, as any other command:sudo shutdown -h now

Yet, in some ways, it seems to be unlike any other command.

The incompatibility with metacity oddityFor some reason unknown to me, it is impossible to include the shutdown command in the metacity user-defined keyboard shortcuts.Thus, whilesudo shutdown -h nowworks fine from terminal, it won't respond when included in a metacity shortcut (as explained in the post about shutdown keyboard shortcuts).

The CTRL-ALT-DEL oddityIn the default Dapper install, CTRL-ALT-DEL, a key combination used to reboot or shutdown, works only from the console, not from the GUI or even a terminalemulator.

Although it is commented out in /etc/inittab

# What to do when CTRL-ALT-DEL is pressed.ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

CTRL-ALT-DEL has no effect when used in the usual desktop environment.

man shutdown explains that CTRL-ALT-DEL is only recognized by the console [CTRL-ALT (F1 to F6) launch six independent consoles]. It is a unique key combination.Even after removing the -a switch (see below) from the shutdown command in /etc/inittab (see above), CTRL-ALT-DEL is still recognized exclusively from the console.

The -a switch goes hand in hand with CTRL-ALT-DELFurthermore,the -a switch, as in the command in the /etc/inittab file above, points to a file, /etc/shutdown.allow, which lists the users authorized to use the CTRL-ALT-DEL combination.The -a switch is part and parcel of the CTRL-ALT-DEL key combination management- it only affects who can use this key combination. So the -a switch, too, is irrelevant on the desktop...

Indeed, upon creation of the /etc/shutdown.allow file with my username, as Metalheart suggested, could make CTRL-ALT-DEL work from the console, but still not from the terminal emulator.

This, even though the /etc/shutdown.allow file is there:#list of users allowed to use CTRL-ALT-DEL, a key combination that *only* works from the console.jackn

The above results obtained after logging out and back in, for changes to take effect (prior to that, with the same files, the shell didn't even prompt for the password with the above command, but went right away to the next prompt).

Why and to be studiedAs explained in man shutdown, the stringent management of CTRL-ALT-DEL must have to do with the days in which people worked on terminals hookd up to a central computer. Without such strictly regulated access, any user could have brought down the system from any terminal. I don't know if the keeping up of this setup serves any purpose today.

One issue remains to be studied, then:What is it that doesn't allow the shutdown command, effective on the terminal, to work with metacity shortcuts like any other terminal command?