 |
Linux Format forums Help, discussion, magazine feedback and more
|
| View previous topic :: View next topic |
| Author |
Message |
chriswadams
Joined: Tue Dec 01, 2009 12:54 am Posts: 26
|
Posted: Sat Mar 09, 2013 1:51 am Post subject: [SOLVED] Ubuntu w/ Openbox -- shutdown doesn't work properly |
|
|
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: | <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: | # 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 |
|
| Back to top |
|
 |
nelz Moderator

Joined: Mon Apr 04, 2005 12:52 pm Posts: 8000 Location: Warrington, UK
|
Posted: Sat Mar 09, 2013 9:47 am Post subject: |
|
|
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.
Then add
| Code: | | yourusername ALL = NOPASSWD: /sbin/shutdown |
_________________ Unix is user-friendly. It's just very selective about who it's friends are. |
|
| Back to top |
|
 |
chriswadams
Joined: Tue Dec 01, 2009 12:54 am Posts: 26
|
Posted: Sat Mar 09, 2013 1:27 pm Post subject: [SOLVED] Ubuntu w/ Openbox -- shutdown doesn't work properly |
|
|
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 |
|
| Back to top |
|
 |
| View previous topic :: View next topic |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|