[SOLVED] Ubuntu w/ Openbox -- shutdown doesn't work properly

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

[SOLVED] Ubuntu w/ Openbox -- shutdown doesn't work properly

Postby chriswadams » Sat Mar 09, 2013 1:51 am

I've recently installed Ubuntu's 12.04 mini.iso with Openbox and Simple Login Manager, on an Acer Aspire One netbook. I want to be able to shutdown and restart from the Openbox menu, but I can't get it to work. There are a number of threads with solutions to similar problems over on the Ubuntu Forums, but none of them has worked for me. Note that I can shutdown with the terminal command '$sudo shutdown -h now'.

Here is the XML I have in my 'menu.rc' file:

Code: Select all
<item label="Restart">
    <action name="Execute">
       <prompt>Are you sure you want to Restart?</prompt>
       <command>sudo shutdown -r now</command>
    </action>
  </item>  <item label="Shutdown">
    <action name="Execute">
    <prompt>Are you sure you want to Shutdown?</prompt>
       <execute>sudo shutdown -h now</execute>
    </action>


In place of the command 'sudo shutdown -h now', I have used 'sudo /sbin/shutdown -h now', 'sudo /sbin/halt', 'gksu shutdown -h now', 'x-terminal-emulator -t sudo shutdown -h now', and even 'x-terminal-emulator -t shutdown -h now'. Nothing works.

My visudo file looks like this:

Code: Select all
# User privilege specification
root   ALL=(ALL:ALL) ALL
%shutdown ALL=(root)NOPASSWD: /sbin/reboot
%shutdown ALL=(root)NOPASSWD: /sbin/halt
%shutdown ALL=(root)NOPASSWD: /sbin/shutdown

%admin ALL=(ALL)ALL
%admin ALL=NOPASSWD: /sbin/reboot, /sbin/halt, /sbin/shutdown

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL


Any help would be appreciated.

Thanks,
Chris Adams.
Last edited by chriswadams on Sat Mar 09, 2013 1:28 pm, edited 1 time in total.
User avatar
chriswadams
 
Posts: 26
Joined: Tue Dec 01, 2009 12:54 am

Postby nelz » Sat Mar 09, 2013 9:47 am

It would hel p if you were more specific than "not works". Do you get any error messages? Are there any entries in the system log?

I susepct that sudo wants a password but doesn't have a terminal to ask for it. You could try gksudo instead, or use visudo to edit /etc/sudoers to allow /sbin/shutdown to be run without a password.

Code: Select all
visudo


Then add

Code: Select all
yourusername ALL = NOPASSWD: /sbin/shutdown
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8469
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

[SOLVED] Ubuntu w/ Openbox -- shutdown doesn't work properly

Postby chriswadams » Sat Mar 09, 2013 1:27 pm

Nelz --

I apologize for my vagueness; by "not works", I meant that the shutdown command simply wouldn't do anything. It wouldn't give any response at all.

But your suggestion worked perfectly. Thanks so much for your help!

Chris Adams
User avatar
chriswadams
 
Posts: 26
Joined: Tue Dec 01, 2009 12:54 am


Return to Help!

Who is online

Users browsing this forum: No registered users and 0 guests

cron