SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2014-10-27 14:15:29

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 1,031
Website

[RESOLVED] Openbox: computer freezes with reboot/poweroff menu entries

Hey there everyone!

Ubu 14.04 minimal
Openbox
No GDM

I'm goofing around with duplicating the graphical enviroment of Wally in Ubu 14.04.  I've managed to get it pretty close to OOtB usability, but am foiled by reboot/poweroff.

I've tried using cb-exit, but that didn't go far due to errors galore.   I've edited the sudoers file to allow reboot, poweroff and shutdown without a password.  I've confirmed it by making sure a password isn't required when running the commands in terminal. All was good to go.

The issue, however is that if I place sudo reboot/poweroff/shutdown -r(-h) now into OB's menu , when I execute the menu entry, the machine freezes, requiring a hard restart.

I'm not seeing anything in /var/log, I think it's freezing before anything can be written. The commands don't cause any issue in terminal so I'm not sure where to go from here.

Any thoughts on getting a poweroff and reboot option in the menu?

Thanks for your consideration!

Last edited by schwim (2014-10-28 18:25:05)

Offline

Be excellent to each other!

#2 2014-10-27 14:47:11

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: [RESOLVED] Openbox: computer freezes with reboot/poweroff menu entries

Edit the sudoers file:

sudo /usr/sbin/visudo

Add these lines (the last two you see here):

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL
ALL   ALL=NOPASSWD:/sbin/reboot
ALL   ALL=NOPASSWD:/sbin/poweroff

Now in Openbox menu.xml - or use the GUI menu editor:

		<item label="Punch Out">
			<action name="Execute">
				<command>terminator -e &quot;kill -9 -1&quot;</command>
			</action>
		</item>
		<item label="Re-Boot">
			<action name="Execute">
				<command>sudo /sbin/reboot</command>
			</action>
		</item>
		<item label="Power Down">
			<action name="Execute">
				<command>sudo /sbin/poweroff</command>
			</action>
		</item>

2014_10_27_11_46_09_1920x1080_Sector11.jpg


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#3 2014-10-27 15:06:40

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 1,031
Website

Re: [RESOLVED] Openbox: computer freezes with reboot/poweroff menu entries

Thanks a bunch for your help, s11!

Your other thread concerning this is what got me this far.  Thanks very much for documenting your progress.  The issue I'm having is that although these commands work in the terminal(without need of password), when added to my OB menu, it freezes the computer upon execution.

I'll continue goofing with it.  It's pretty much the last thing I need before I've got a good base install.

Thanks again for your help!

Offline

#4 2014-10-27 16:23:08

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: [RESOLVED] Openbox: computer freezes with reboot/poweroff menu entries

Forgot all about that thread  smile

Sounds like Ubuntu is playing mind games with you.

How about three no nonsense bash files?
pwrdn

#!/bin/bash
sudo /sbin/poweroff

pout

#!/bin/bash
kill -9 -1

rboot

#!/bin/bash
sudo /sbin/reboot

If you can run those from [Alt-F2] or [Alt+F3] it should work in the OB Menu as well.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#5 2014-10-27 16:58:17

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 1,031
Website

Re: [RESOLVED] Openbox: computer freezes with reboot/poweroff menu entries

Same issue with the bash files.  A couple things I'm finding out though.  First, my sudoers doesn't seem to be sticking between reboots.

ALL   ALL=NOPASSWD:/sbin/poweroff, /sbin/shutdown, /sbin/halt, /sbin/reboot

After rebooting successfully without password, I'm finding that it's asking me for me the password this time.  Second, it's not freezing the whole machine, just the graphical environment.  I can alt-ctrl-F1 and Ctrl+C to restart x.  I looked in dmesg and Xorg.0.log.old but I'm not finding anything that looks like a related error.  I'll comb over it more closely as I'm probably missing something.

Offline

#6 2014-10-27 21:13:36

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: [RESOLVED] Openbox: computer freezes with reboot/poweroff menu entries

Well, it's Official.

I'm at a loss.  if editing the sudoers file didn't do it ... Ubuntu is out to get us!  wink


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#7 2014-10-27 21:44:20

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 1,031
Website

Re: [RESOLVED] Openbox: computer freezes with reboot/poweroff menu entries

Do you see anything wrong with how I entered the line into sudoers?  "sudo /sbin/reboot" is asking me for a password in spite of the entry(added via visudo).

I'm at a loss as well and haven't figured out anything more in spite of continuing to screw with it.

Offline

#8 2014-10-27 21:57:19

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: [RESOLVED] Openbox: computer freezes with reboot/poweroff menu entries

Try separate lines as I did in Post #2 ... I am no expert by any means.  I know this works with #!.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#9 2014-10-28 12:11:08

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 1,031
Website

Re: [RESOLVED] Openbox: computer freezes with reboot/poweroff menu entries

Still not working.  For some reason, it's not registering my additions.  Does placement in the file matter?  I'm placing right below the root entry.

Offline

#10 2014-10-28 12:40:59

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: [RESOLVED] Openbox: computer freezes with reboot/poweroff menu entries

I don't think so ...  here's my complete file:

#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults	env_reset
Defaults	mail_badpass
Defaults	secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root	ALL=(ALL:ALL) ALL

# Allow members of group sudo to execute any command
%sudo	ALL=(ALL:ALL) ALL
ALL	ALL=NOPASSWD:/sbin/reboot
ALL	ALL=NOPASSWD:/sbin/poweroff

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#11 2014-10-28 18:06:19

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,434

Re: [RESOLVED] Openbox: computer freezes with reboot/poweroff menu entries

How about trying a workaround by putting the shutdown/reboot commands in scripts, and calling the script from an OB menu item?


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

#12 2014-10-28 18:24:39

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: [RESOLVED] Openbox: computer freezes with reboot/poweroff menu entries

^ Tried that in post #4.

Gotta be an Ubuntu thing.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#13 2014-10-28 18:24:47

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 1,031
Website

Re: [RESOLVED] Openbox: computer freezes with reboot/poweroff menu entries

Solved!

While penning my plea to the Ubu forum-goers, I found this helpful wiki entry, which explained that my commands were being overwritten by the admin and sudo entries below it.  Moving it to the bottom of the file got me a passwordless poweroff and reboot and subsequently, a working menu entry! Hooray!

Thanks a bunch for all your help, sector big_smile

Offline

#14 2014-10-28 18:36:44

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: [RESOLVED] Openbox: computer freezes with reboot/poweroff menu entries

Interestingly enough the #! sudoers fiile doesn't have:

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

Does placement in the file matter?  I'm placing right below the root entry.

I said I didn't think so, mine like yours was right after root entry.  Mine is the last entries, unlike yours that has that extra UBU admin group stuff.

scheech ... at least it's fixed ... finally.

And how do you spell: relief? --> *I*t*w*o*r*k*s*!*

help? what help, you found the solution ... I had ya running in circles after nailing your left foot to the floor.  big_smile
OK ... you're welcome.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#15 2014-10-28 19:35:47

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,434

Re: [RESOLVED] Openbox: computer freezes with reboot/poweroff menu entries

Sector11 wrote:

help? what help, you found the solution ... I had ya running in circles after nailing your left foot to the floor.

That's where you went wrong. You should have searched the forums first - you would have found the answer is to nail the right foot to the floor ]:D


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

#16 2014-10-28 21:45:58

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: [RESOLVED] Openbox: computer freezes with reboot/poweroff menu entries

:8 :8 I stand humbled and shamed.  :8  :8

The difference between right and right is the same as the difference between left and wrong.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#17 2014-10-28 23:13:07

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 1,031
Website

Re: [RESOLVED] Openbox: computer freezes with reboot/poweroff menu entries

Wow, damo, you've created some fantastic themes!  I'm worryingly attached to the color orange, so might have to grab the autumn theme smile

Offline

#18 2014-10-28 23:24:49

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,434

Re: [RESOLVED] Openbox: computer freezes with reboot/poweroff menu entries

Glad you like it - maybe you could have a go at tweaking it and show us what you come up with wink

That 4Seasons group of themes are a bit playful, but are a little too bright and dramatic for my current tastes!

Last edited by damo (2014-10-28 23:25:47)


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo