You are not logged in.
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
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
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
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