I've recently installed Openbox,and read a guide that said the PC should be shut down via this command:

gdm-control --shutdown && openbox --exit

However, it seems a bit counter intuitive. Why would I shut the computer down first and then exit Openbox? How is that even possible?

Or is it maybe that gdm-control --shutdown just sends a message somewhere? What if the computer shuts down before Openbox can exit? Is this really "the right way"?


Link to Openbox guide: http://urukrama.wordpress.com/openbox-guide/
OS: Debian Linux 7.0

  • So you are asking what is the correct/optimal way to shut it down properly?
    – superuser0
    Commented Apr 21, 2013 at 14:59
  • Is a link available for this guide you've mentioned? You are asking about Openbox, the window manager? I'm using it because it's the default window manager in Lubuntu and I've not come across such advice. What OS are you running?
    – user15760
    Commented Apr 21, 2013 at 15:52
  • @vasa1: check out the edit. I'm running bare Openbox, no desktop environment.
    – jcora
    Commented Apr 21, 2013 at 17:15

2 Answers 2


Make an alias like this. Then just type shut.

alias shut="su -c 'shutdown -h now'"

You need to be root to do it, that's why you first set the user to superuser (su), then issue the command (-c). The -h is for "halt" after shutdown, i.e., don't reboot (or do anything else).


I'm a bite late to the party, but to answer the question how is that even possible, the man page for gdm-control says it all:

       gdm-control lets you control gdm from within an X session.  It enables
       you to change GDM's behaviour for when you end the current sesson.  For
       instance, you can tell GDM to reboot, and then immediately log out of
       the current session, and the computer will be rebooted


            Shutdown the computer when the current session ends.

So you tell gdm to shutdown when the session ends, then end the session.

For myself, I tried what was suggested in this question and found that systemctl poweroff worked fine for me.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .