You are not logged in.
Hi there,
on my system running with Openbox I have installed the "obshutdown"-Tool for kind of a smart shutdown. The problem: obshutdown refuses to shut down - as it seems due to some kind of authorization problem.
What have I done?
1. Installed obshutdown from AUR and copied the /usr/share/obshutdown/example.rc to ~/.obshutdown.rc
The .obshutdown.rc looks like this:
# Openbox shutdown dialog
# This is example obshutdown rc file
# Copy this file to ~/.obshutdown.rc and customise
#
[general]
version = 0.1-rc1
verbose = false
default_action = shutdown
composite = true
theme = foom
buttons = cancel logout shutdown restart suspend hibernate
[actions]
logout = openbox --exit
shutdown = dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
restart = dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart
lock =
switch =
suspend = dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend
hibernate = dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Hibernate
custom =
[shortcuts]
logout = l
shutdown = s
restart = r
lock =
switch =
suspend = u
hibernate = h
custom =
[labels]
cancel = CANCEL
logout = LOGOUT
restart = RESTART
shutdown = SHUTDOWN
lock = LOCK
switch = SWITCH USER
suspend = SUSPEND
hibernate = HIBERNATE
2. I have installed "upower"
3. My user is a member of the group "power"
[nihonto@sushi ~]$ groups
lp wheel network video audio optical storage power users
4. I use xdm as login manager
5. My .xsession
exec ck-launch-session dbus-launch openbox-session
Edit (23-01-2012): Here, in .xsession it went wrong: "ck-launch-session" has to be removed from this line! (see last posting)
4. ck-list-session says:
Session1:
unix-user = '1000'
realname = ''
seat = 'Seat1'
session-type = ''
active = TRUE
x11-display = ':0'
x11-display-device = '/dev/tty8'
display-device = ''
remote-host-name = ''
is-local = TRUE
on-since = '2012-01-21T12:05:27.811377Z'
login-session-id = '4294967295'
Session2:
unix-user = '1000'
realname = ''
seat = 'Seat1'
session-type = ''
active = FALSE
x11-display = ':0'
x11-display-device = '/dev/tty8'
display-device = ''
remote-host-name = ''
is-local = TRUE
on-since = '2012-01-21T12:05:28.168600Z'
login-session-id = '4294967295'
I have placed a button in my wbar-panel that calls /usr/bin/obshutdown and when I invoke it, I get the shutdown - restart - and so on Buttons on my screen. But except the "logout"-Button nothing works.
As far as I can see (and mentioned above), it is because of some authorization problem. This happens, when i call the consolekit order for shutdown from .obshutdown.rc:
[nihonto@sushi ~]$ dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
Error org.freedesktop.ConsoleKit.Manager.NotPrivileged: Not Authorized
Do I have to edit /etc/sudoers? I thought this won't be necessary if I use consolekit?! At least - this is how I read this article of the Wiki.
So, where am I wrong?
Last edited by swordfish (2012-01-23 20:55:22)
Arch_x64 on Thinkpad Edge E520 (Intel Core i5, 4 GB RAM, 128 GB Crucial M4 SSD) + ITX-Desktop (Asrock H77M-ITX, Intel Core i3-2120T, 8GB RAM, 64 GB Samsung 830 SSD)
Offline
I've read these consolekit commands require upower and pm-utils. Do you have the latter installed?
If you do and it still doesn't work some have edited the sudoers file to be able to run halt/reboot without a password and changing the long dbus/consolekit line to the simpler commands "/sbin/halt."
I don't think you should have to edit your sudoers file unless you choose to go with that second option.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I've read these consolekit commands require upower and pm-utils. Do you have the latter installed?
Yepp, upower and pm-utils are both installed. Hmmm, strange thing. I thought it would be easier with consolekit ...
Arch_x64 on Thinkpad Edge E520 (Intel Core i5, 4 GB RAM, 128 GB Crucial M4 SSD) + ITX-Desktop (Asrock H77M-ITX, Intel Core i3-2120T, 8GB RAM, 64 GB Samsung 830 SSD)
Offline
Are you starting your openbox session with consolekit?
exec ck-launch-session dbus-launch openbox-session
I didn't know about obshutdown. I finally found a script online that did it. It uses the same command and works fine here, though.
Edit: Also, make sure you are part of the power group.
Edit2: Missed some parts of your post. It could require restarting with the stated groups being included. I recall from when using GNOME that sometimes e.g. after an update, this method would be unavailable.
Last edited by majiq (2012-01-21 17:31:10)
Offline
Are you starting your openbox session with consolekit?
exec ck-launch-session dbus-launch openbox-session
I didn't know about obshutdown. I finally found a script online that did it. It uses the same command and works fine here, though.
Edit: Also, make sure you are part of the power group.
You haven't read my first posting, don't you ?
Arch_x64 on Thinkpad Edge E520 (Intel Core i5, 4 GB RAM, 128 GB Crucial M4 SSD) + ITX-Desktop (Asrock H77M-ITX, Intel Core i3-2120T, 8GB RAM, 64 GB Samsung 830 SSD)
Offline
majiq wrote:Are you starting your openbox session with consolekit?
exec ck-launch-session dbus-launch openbox-session
I didn't know about obshutdown. I finally found a script online that did it. It uses the same command and works fine here, though.
Edit: Also, make sure you are part of the power group.
You haven't read my first posting, don't you
?
Okay, you caught me. :-/ but I only skipped points...2-4? Anyway, I stand by edit2. Does it hold across reboots?
Offline
Okay, doing a little checking, I've found that /etc/polkit-1/localauthority.conf.d/50-localauthority.conf is the configuration file for the polkit. I believe the default is set to wheel. Change this to power or add yourself to the wheel group for permission.
Offline
Anyway, I stand by edit2. Does it hold across reboots?
Yes, it does (but nothing changes )
Okay, doing a little checking, I've found that /etc/polkit-1/localauthority.conf.d/50-localauthority.conf is the configuration file for the polkit. I believe the default is set to wheel. Change this to power or add yourself to the wheel group for permission.
Hmmm, my user is already a member of the group "wheel"
Arch_x64 on Thinkpad Edge E520 (Intel Core i5, 4 GB RAM, 128 GB Crucial M4 SSD) + ITX-Desktop (Asrock H77M-ITX, Intel Core i3-2120T, 8GB RAM, 64 GB Samsung 830 SSD)
Offline
Hmmm, strange thing: If I start Openbox from runlevel 3 with "startx" obshutdown works as it should and I can restart or shutdown the system. But if I start Openbox from runlevel 5 and log in with xdm the obshutdown buttons have no effect .
Arch_x64 on Thinkpad Edge E520 (Intel Core i5, 4 GB RAM, 128 GB Crucial M4 SSD) + ITX-Desktop (Asrock H77M-ITX, Intel Core i3-2120T, 8GB RAM, 64 GB Samsung 830 SSD)
Offline
What's in your ~/.xsession?
I'm pretty sure startx always uses ~/.xinitrc, but there is potential for xdm to skip it if it is not sourced or launched from ~/.xsession.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
What's in your ~/.xsession?
I'm pretty sure startx always uses ~/.xinitrc, but there is potential for xdm to skip it if it is not sourced or launched from ~/.xsession.
.xsession is a link to .xinitrc
[nihonto@sushi ~]$ ls -la .x*
-rwxr--r-- 1 nihonto users 83 22. Jan 13:53 .xinitrc
lrwxrwxrwx 1 nihonto users 8 21. Jan 20:17 .xsession -> .xinitrc
And this is my .xinitrc:
exec ck-launch-session dbus-launch --sh-syntax --exit-with-session openbox-session
By the way: xdm is working pretty well with this configuration
Last edited by swordfish (2012-01-22 13:30:14)
Arch_x64 on Thinkpad Edge E520 (Intel Core i5, 4 GB RAM, 128 GB Crucial M4 SSD) + ITX-Desktop (Asrock H77M-ITX, Intel Core i3-2120T, 8GB RAM, 64 GB Samsung 830 SSD)
Offline
I haven't used XDM, but one oddity I noted in the default ~/.xession is the interactive login bash invocation:
#!/bin/sh
/bin/bash --login -i ~/.xinitrc
I'm not sure why it would matter, but that does seem to be the only difference for your starx vs xdm. When you run startx you are already in an interactive shell. Xdm, in your setup, does not launch openbox from an interactive shell. Perhaps there is something in .bashrc or another shell startup file that is needed.
You could test this my changing your ~/.xsession to the line above.
Last edited by Trilby (2012-01-22 15:24:56)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I haven't used XDM, but one oddity I noted in the default ~/.xession is the interactive login bash invocation:
#!/bin/sh /bin/bash --login -i ~/.xinitrc
I'm not sure why it would matter, but that does seem to be the only difference for your starx vs xdm. When you run startx you are already in an interactive shell. Xdm, in your setup, does not launch openbox from an interactive shell. Perhaps there is something in .bashrc or another shell startup file that is needed.
You could test this my changing your ~/.xsession to the line above.
Okay, I deleted my old .xsession being a link to .xinitrc and added a new .xsession with your lines:
#!/bin/sh
/bin/bash --login -i ~/.xinitrc
Then I made the .xsession executable:
$ chmod 744 .xsession
My .xinitrc still looks like this:
exec ck-launch-session dbus-launch --sh-syntax --exit-with-session openbox-session
But all of this doesn't change anything - even if I reboot the laptop . Obshutdown doesn't work for my user.
When I look into /var/log/everything.log I find these lines:
Jan 22 17:20:09 localhost dbus[455]: [system] Activating service name='org.freedesktop.ConsoleKit' (using servicehelper)
Jan 22 17:20:10 localhost dbus[455]: [system] Activating service name='org.freedesktop.PolicyKit1' (using servicehelper)
Jan 22 17:20:10 localhost polkitd[1295]: started daemon version 0.103 using authority implementation `local' version `0.103'
Jan 22 17:20:10 localhost dbus[455]: [system] Successfully activated service 'org.freedesktop.PolicyKit1'
Jan 22 17:20:10 localhost dbus[455]: [system] Successfully activated service 'org.freedesktop.ConsoleKit'
As far as I can see, this looks quite okay. The only line that gets my attention is this one:
localhost polkitd[1295]: started daemon version 0.103 using authority implementation `local' version `0.103'
But how can I check what this means?
Right now, I think the problem is sitting in front of my laptop - I didn't get the clue what's going wrong here
Arch_x64 on Thinkpad Edge E520 (Intel Core i5, 4 GB RAM, 128 GB Crucial M4 SSD) + ITX-Desktop (Asrock H77M-ITX, Intel Core i3-2120T, 8GB RAM, 64 GB Samsung 830 SSD)
Offline
Oooookay - finally I found out what's going wrong, and the solution is quite simple !
It's as simple as this: "xorg-xdm" is also ConsoleKit/PolicyKit capable since version 1.1.11. This means: There is no need to include "ck-launch-session" in .xsession or .xinitrc for xdm. You only need this if you're starting without a login manager like xdm from runlevel 3 (with "startx").
Arch_x64 on Thinkpad Edge E520 (Intel Core i5, 4 GB RAM, 128 GB Crucial M4 SSD) + ITX-Desktop (Asrock H77M-ITX, Intel Core i3-2120T, 8GB RAM, 64 GB Samsung 830 SSD)
Offline