General
cancel
Showing results for 
Search instead for 
Did you mean: 

How to shutdown in logoff mode

SOLVED
Go to solution
Mohammed Shahidul Islam
Occasional Advisor

How to shutdown in logoff mode

Hi
I use Alt+Ctrl+Del to restart a linux machine in logoff mode. what is the command for shutting down a linux machine in logoff mode ?

Please send me the command

Thanks with regards

shahid
4 REPLIES
Oviwan
Honored Contributor

Re: How to shutdown in logoff mode

Hey

I think it's better to login and execute "shutdown -h now". I don't know whether exists a key-combination tho shutdown.
you could press five seconds the start button of your box but that isn't really advisable.

Regards
Matti_Kurkela
Honored Contributor

Re: How to shutdown in logoff mode

When you have logged off, you cannot enter any normal commands without logging on first: this is intentional.

If you want to change the Ctrl-Alt-Del restart function or disable it entirely, look into /etc/inittab and find a line that has the word "ctrlaltdel" on it. This line defines what happens when Ctrl-Alt-Del key combination is pressed. You can change it to execute any command you like.

(Because Windows logon dialog requires pressing Ctrl-Alt-Del, it is recommended to change this setting to some non-default value if you install a Linux machine among several Windows machines: you don't want your Linux to restart if a Windows admin accidentally tries to use a wrong keyboard...)

If your hardware has a functional ACPI implementation and acpid is running, most current Linux distributions can be safely shut down by a _short_ press of the power button.

A long press of the power button (4 seconds or more) causes an abrupt shutdown, but a short press just sends an ACPI event to the OS. In Linux, the event is handled by the acpid daemon, which is usually configured to run "shutdown -h now" in that situation.

Some X display managers (like kdm or gdm) may have an option that allows the machine to be shut down from an option in the login dialog. If you're using KDE desktop, go to Control Center -> System Administration -> Login Manager and examine the Shutdown tab. My knowledge of Gnome is rather limited: it probably has something similar available.

MK
MK
Ivan Ferreira
Honored Contributor
Solution

Re: How to shutdown in logoff mode

You can modify /etc/inittab and instead of reboot, shutdown the system when you press CTRL+ALT+DEL.

You can also use the shutdown system account.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Ralph Grothe
Honored Contributor

Re: How to shutdown in logoff mode

As mentioned by Matti
one better commented out the ctrlaltdel target in /etc/inittab.
If the board supports it (I think most do these days) I usually use "halt -p" to shutdown the box completely with a power off
(maybe comparable to Solaris "shutdown -i5 -g0 -y")
Alternatively, you can use "shutdown -h now"
or "init 0".
If you want to reboot, use the -r option instead of -h with shutdown, or simply say "init 6".
Of course, all these commands require to be executed by root.
Madness, thy name is system administration