Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
So you are asking what is the correct/optimal way to shut it down properly? – superuser0 Apr 21 '13 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 Apr 21 '13 at 15:52
@vasa1: check out the edit. I'm running bare Openbox, no desktop environment. – jcora Apr 21 '13 at 17:15
up vote 0 down vote accepted

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).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.