You are not logged in.

#1 2009-02-06 17:11:27

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

[SOLVED]Shutting down in Arch (Openbox + Fluxbox)

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)


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#2 2009-02-06 19:16:19

Tenken
Member
Registered: 2008-02-01
Posts: 126

Re: [SOLVED]Shutting down in Arch (Openbox + Fluxbox)

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

#3 2009-02-06 19:19:55

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [SOLVED]Shutting down in Arch (Openbox + Fluxbox)

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.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#4 2009-02-06 19:35:30

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: [SOLVED]Shutting down in Arch (Openbox + Fluxbox)

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.

Offline

#5 2009-02-06 22:37:06

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [SOLVED]Shutting down in Arch (Openbox + Fluxbox)

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.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#6 2009-02-06 22:37:51

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [SOLVED]Shutting down in Arch (Openbox + Fluxbox)

I am going to see if the poweroff and the reboot commands work instead of /sbin/shutdown


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#7 2009-02-06 22:45:20

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: [SOLVED]Shutting down in Arch (Openbox + Fluxbox)

%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

#8 2009-02-06 22:53:18

quarkup
Member
From: Portugal
Registered: 2008-09-07
Posts: 497
Website

Re: [SOLVED]Shutting down in Arch (Openbox + Fluxbox)

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

#9 2009-02-06 22:55:48

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [SOLVED]Shutting down in Arch (Openbox + Fluxbox)

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)


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#10 2009-02-06 23:09:18

quarkup
Member
From: Portugal
Registered: 2008-09-07
Posts: 497
Website

Re: [SOLVED]Shutting down in Arch (Openbox + Fluxbox)

: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

#11 2009-02-07 15:36:23

3ner
Member
Registered: 2007-12-29
Posts: 12

Re: [SOLVED]Shutting down in Arch (Openbox + Fluxbox)

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

#12 2009-02-07 16:05:13

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: [SOLVED]Shutting down in Arch (Openbox + Fluxbox)

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

#13 2009-02-07 17:33:12

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: [SOLVED]Shutting down in Arch (Openbox + Fluxbox)

Yeah, allowing everything to be run with sudo and without a password is a bad idea.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#14 2009-02-07 20:50:51

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [SOLVED]Shutting down in Arch (Openbox + Fluxbox)

moljac024 wrote:

You really shouldn't use sudo for running any possible command as root, that's not why it was made

Xyne wrote:

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.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#15 2009-02-07 22:58:51

quarkup
Member
From: Portugal
Registered: 2008-09-07
Posts: 497
Website

Re: [SOLVED]Shutting down in Arch (Openbox + Fluxbox)

3ner wrote:

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 wink


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

#16 2009-02-08 16:41:09

absolutezero1287
Member
Registered: 2008-11-13
Posts: 133

Re: [SOLVED]Shutting down in Arch (Openbox + Fluxbox)

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

Board footer

Powered by FluxBB