You are not logged in.

#1 2012-04-08 14:56:05

cmm7825
Member
Registered: 2012-04-08
Posts: 22

Xmonad doesn't have permissions to reboot when started via init[SOLVED

In my xmonad.hs I have keyboard shortcuts for rebooting and halting:


, ((mod4Mask .|. shiftMask, xK_F12), spawn "dbus-send --system --print-reply --dest=\"org.freedesktop.ConsoleKit\" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop")

, ((mod4Mask .|. shiftMask, xK_F11), spawn "dbus-send --system --print-reply --dest=\"org.freedesktop.ConsoleKit\" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart")


This works fine when I startx manually. However, when I boot in to run level 5 this doesn't work. Here is the line from my initab to startx:

x:5:once:/bin/su - -- chris -l -c '/usr/bin/startx </dev/null > /dev/null 2>&1'

From looking at the ps output it seems like X and xmonad are running under my username, so I'm not sure why it would make a difference.

Last edited by cmm7825 (2012-04-09 02:07:15)

Offline

#2 2012-04-08 17:08:42

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Xmonad doesn't have permissions to reboot when started via init[SOLVED

I'm not sure why it doesn't work - it is odd that X are running under your usernam.  X itself should be root.

Anyways, I have a few ideas on how to get the desired results.  First, you could boot to runlevel 3 with autologin and a modified bashrc to startx when in a console on ttyi1 (this is in the wiki).

Alternately, and probably a lot easier, would be to just put reboot and halt/shutdown in your sudoers file to not need a password.  Then there is no need for consolekit ... and if you do not have anything else that depends on consolekit you can ditch it all together.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2012-04-09 01:19:27

cmm7825
Member
Registered: 2012-04-08
Posts: 22

Re: Xmonad doesn't have permissions to reboot when started via init[SOLVED

I already tried that, with no luck. Also, I was mistaken, X is running as root but xmonad and xinit are running as me.

Offline

#4 2012-04-09 02:06:12

cmm7825
Member
Registered: 2012-04-08
Posts: 22

Re: Xmonad doesn't have permissions to reboot when started via init[SOLVED

Ok I got the sudo /sbin/shutdown method working. I didn't realize the order of the sudoers file mattered. I had to put the NOPASSWD shutdown rule AFTER my rule to allow members of %wheel run any command. Not sure why.

Thanks,
Chris

Offline

Board footer

Powered by FluxBB