You are not logged in.
The other OPs thread got solved....but my issue didn't. So here it is again.
I have openbox and fluxbox installed on Arch:
1) Openbox stops responding on clicking either Reboot or Shutdown from the menu. Only option kill X.
2) Fluxbox doesnt have a care in the world...it keeps working...menus and all
Debian has Fluxbox installed...and shutdown and reboot work as they should.
My sudoers file has this
inxsible ALL=NOPASSWD: /sbin/shutdown
My menu file in openbox has
sudo /sbin/shutdown -r now
for the Reboot and
sudo /sbin/shutdown -h now
for the Shutdown.
I think this is specific to Arch because the same thing works well in my Debian install.
I do have acpid installed...so all is not lost. Its just that it pisses me off that this doesn't work for me when it does for everyone else.
Last edited by Inxsible (2009-02-06 22:59:39)
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
I have a similar setup with openbox. Here are the entries I have in my menu.
Restart
sudo reboot
Shutdown
sudo shutown -h now
In my sudoers file I give no password to the specific shutdown command and to reboot.
user ALL=NOPASSWD: /sbin/shutdown - h now,/sbin/reboot
Offline
So the only difference is that your sudoers file lists the command explicitly using the -h and -r flags, whereas I only have the command name ie. /sbin/shutdown. Maybe thats the reason.
But honestly, the flags of a command should not matter while giving sudo access to it.
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
don't know if this matters but i have different syntax for user lines and all lines... like this:
root ALL=(ALL) ALL
patrick ALL=(ALL) ALL
patrick ALL=(ALL) NOPASSWD: /usr/bin/pacman
patrick ALL=(ALL) NOPASSWD: /usr/bin/pacman-color
patrick ALL=(ALL) NOPASSWD: /usr/bin/powerpill
ALL ALL=NOPASSWD: /sbin/telinit
ALL ALL=NOPASSWD: /sbin/shutdown
ALL ALL=NOPASSWD: /sbin/reboot
this setup works for me in openbox.
//github/
Offline
This is the weirdest thing. I changed my sudoers to what brisbin said and made it
inxsible ALL=(ALL) NOPASSWD: /sbin/shutdown
Then I tried rebooting and it worked, then shutdown worked as well....then i booted into Fluxbox to try it out again adn this time reboot worked and then shutdown didnt.
Now, again, neither options work in either Openbox or Fluxbox. The same thing I mentioned in my first post happens again.
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
I am going to see if the poweroff and the reboot commands work instead of /sbin/shutdown
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
%users ALL=(ALL) NOPASSWD: /sbin/shutdown -h now
%users ALL=(ALL) NOPASSWD: /sbin/shutdown -r now
Try this
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
my sudoer's file contains this at it's end
%users ALL=(ALL) NOPASSWD:/sbin/mount /media/cdrom,/sbin/umount /media/cdrom
%users localhost=(ALL) NOPASSWD:/sbin/shutdown -h now
and Im fine with fluxbox
notice: change your ~/.fluxbox/menu file with this
[exec] (Shutdown) {sudo /sbin/shutdown -h now}
[exec] (Reboot) {sudo /sbin/shutdown -r now}
Last edited by quarkup (2009-02-06 23:09:10)
If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is.
Simplicity is the ultimate sophistication.
Offline
Ok I feel like a f*ing idiot now !!!
I checked my sudoers again and the problem was this. After I enabled my user name to have NOPASSWD to /sbin/shutdown, I had another line in sudoers down below which was
%wheel ALL=(ALL) ALL
That was negating the statement above. But I am still surprised how it worked 3 times before deciding not to.
Anyway, I have now removed the username line and simply uncommented this one
%wheel ALL=(ALL) NOPASSWD: ALL
Now I dont need to worry about entering a password anywhere
Last edited by Inxsible (2009-02-06 23:00:11)
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
:d
If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is.
Simplicity is the ultimate sophistication.
Offline
It probably worked sometimes, because you did "sudo something" short time before and sudo remembered the password until you did the shutdown from your menu.
Edit: In case you're not happy with never entering the password:
Although I don't have the %wheel line in my sudoers file, I guess it will work, if it stands above the NOPASSWD lines.
Last edited by 3ner (2009-02-07 15:37:21)
Offline
You really shouldn't use sudo for running any possible command as root, that's not why it was made
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
Yeah, allowing everything to be run with sudo and without a password is a bad idea.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
You really shouldn't use sudo for running any possible command as root, that's not why it was made
Yeah, allowing everything to be run with sudo and without a password is a bad idea.
Agreed !!
I have since gone back to giving the username NOPASSWD access to only /sbin/shutdown.
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
It probably worked sometimes, because you did "sudo something" short time before and sudo remembered the password until you did the shutdown from your menu.
Edit: In case you're not happy with never entering the password:
Although I don't have the %wheel line in my sudoers file, I guess it will work, if it stands above the NOPASSWD lines.
the %wheel line stands for the "wheel" group
If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is.
Simplicity is the ultimate sophistication.
Offline
When I was using fluxbox I used gxmessage and a script.
#!/bin/bash
gxmessage -borderless "Are you sure you want to shut down your computer?" -center -title "Take action" -font "Sans bold 10" -default "Cancel" -buttons "_Cancel":1,"_Reboot":2,"_Shutdown":3 >/dev/null
case $? in
1)
echo "Exit";;
2)
sudo reboot;;
3)
sudo halt;;
esac
Its not my work and unfortunately I can't remember the author of the script. I think that I found it via google.
Offline