Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

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

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help!
View previous topic :: View next topic  
Author Message
chriswadams



Joined: Tue Dec 01, 2009 12:54 am
Posts: 26

PostPosted: Sat Mar 09, 2013 1:51 am    Post subject: [SOLVED] Ubuntu w/ Openbox -- shutdown doesn't work properly Reply with quote

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
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8364
Location: Warrington, UK

PostPosted: Sat Mar 09, 2013 9:47 am    Post subject: Reply with quote

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:
visudo


Then add

Code:
yourusername ALL = NOPASSWD: /sbin/shutdown

_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
chriswadams



Joined: Tue Dec 01, 2009 12:54 am
Posts: 26

PostPosted: Sat Mar 09, 2013 1:27 pm    Post subject: [SOLVED] Ubuntu w/ Openbox -- shutdown doesn't work properly Reply with quote

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 user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help! All times are GMT
Page 1 of 1

 
Jump to:  
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
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast