Shut down from desktop with ctrl-alt-delete

May 26, 2015 2 Replies

If I'm running the Raspbian GUI desktop but haven't got a monitor connected, I'd like to be able to shut down with ctrl-alt-del.



With earlier versions of Raspbian, it was sufficient to change the shutdown option in /etc/inittab from -r to -h like so:



ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -h now



Raspbian has got cleverer, however, and ctrl-alt-del now pops up a task manager like other desktops. How do I disable that?


Searching on: debian ctl-alt-del mapping to shutdown gives us this:

formatting link

Just cd into /lib/systemd/system/ and change the symlink of ctrl-alt-del.target from reboot.target to poweroff.target.

ln -s /lib/systemd/system/poweroff.target /etc/systemd/system/ctrl-alt-del.target

then reset systemd daemon: systemctl daemon-reload

And lots of links to "how do I stop that sequence from rebooting my machine". But the above is for systemd enabled systems, which you may not have.

An alternative would be:

ctl-alt-f1 (go to a terminal) ctl-alt-del

I *think* if you put the above in your inittab as you describe, you'll get a shutdown instead of a reboot.

Out of curiousity, why are you running a GUI on a headless device?

Consulting Minister for Consultants, DNRC I can please only one person per day. Today is not your day. Tomorrow isn't looking good, either. I am BOFH. Resistance is futile. Your network will be assimilated.

I've just revisited this, and found a solution, so I'll post it here for the record.

(I tend to run the Desktop on headless Pis because the desktop is easier to use when a monitor _is_ attached, and I don't always know in advance if I'll be plugging a given SD-card into a Pi without a monitor.)

edit /home/pi/.config/openbox/lxde-pi-rc.xml

find the line: lxtask

change it to: sudo halt

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required