FS#25031 - [dbus, consolekit] /etc/X11/xinit/xinitrc.d/30-dbus breaks consolekit permissions
Attached to Project:
Arch Linux
Opened by Daniel Micay (thestinger) - Tuesday, 05 July 2011, 17:00 GMT
Last edited by Dave Reisner (falconindy) - Saturday, 20 October 2012, 19:22 GMT
Opened by Daniel Micay (thestinger) - Tuesday, 05 July 2011, 17:00 GMT
Last edited by Dave Reisner (falconindy) - Saturday, 20 October 2012, 19:22 GMT
|
Details
Description:
To get proper consolekit permissions such as the ability to mount drives as a regular user, dbus-launch needs to be run after ck-launch-session. Desktop environments run dbus-launch if it hasn't already been done, so `ck-launch-session startxfce4` has worked fine in the past. WM users have been able to start add a `dbus-launch` command after ck-launch-session to get the same thing. Now that Arch's dbus package includes an xinitrc.d script to start the dbus session automatically, it gets started before ck-launch-session, and attempting to mount a drive in programs like Thunar results in a 'not authorized' message. There are two obvious solutions to the problem: 1) a script could be included in the consolekit package which runs ck-launch-session before the dbus script 2) the dbus script could be removed The first solution is tempting, because it would get rid of a very common issue along with this bug. However, I don't think that starting dbus or consolekit automatically just because they are installed follows Arch's principles, regardless of what upstream thinks. Additional info: dbus 1.4.12-1 consolekit 0.4.5-1 Steps to reproduce: Install Xfce4, start it with the attached xinitrc and try mounting a drive in Thunar. |
This task depends upon
Closed by Dave Reisner (falconindy)
Saturday, 20 October 2012, 19:22 GMT
Reason for closing: Won't fix
Additional comments about closing: CK is being dropped.
Saturday, 20 October 2012, 19:22 GMT
Reason for closing: Won't fix
Additional comments about closing: CK is being dropped.
I don't currently use consolekit or a DE, so I wasn't aware of the problem until I checked today after this discussion on the wiki: https://wiki.archlinux.org/index.php/User_talk:Thestinger#startxfce4_vs_xfce4-session.
see https://bbs.archlinux.org/viewtopic.php?id=128000
$ echo $DBUS_SESSION_BUS_ADDRESS
unix:abstract=/tmp/dbus-7IzVsp4eIi,guid=15f7f168a2d064877ba665d200000163/xdg/xfce4/xinitrc
$
$ grep -i dbus /etc
# Use dbus-launch if installed.
if test x"$DBUS_SESSION_BUS_ADDRESS" = x""; then
if which dbus-launch >/dev/null 2>&1; then
eval `dbus-launch --sh-syntax --exit-with-session`
# some older versions of dbus don't export the var properly
export DBUS_SESSION_BUS_ADDRESS
echo "Could not find dbus-launch; Xfce will not work properly" >&2
Anyway, the .xinitrc skeleton is totally wrong because dbus-launch has to be started AFTER ck session is initialized, otherwise thunar can't properly connect to polkit for authorization. That's why commenting 30-dbus worked for you. That's what .xinitrc is supposed to look like: "exec ck-launch-session startxfce4".
https://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines#Reasons_for_not_being_a_bug defines some reasons, which one are you referring to?
Maybe it could be closed as "upstream" and reported to https://bugs.freedesktop.org/ ?
The wiki also touches on the issue: https://wiki.archlinux.org/index.php/Xfce#Manually (see the second note)
*GNOME/Nautilus:
When 30-dbus is executable I can't mount the drive (same problem as in Xfce/Thunar); but there's more: if I start GNOME with the image loaded in VirtualBox (but not mounted in the system) GNOME can't start in Shell mode, and starts in Fallback mode; if I load the image after GNOME has started, GNOME starts correctly in Shell mode.
When 30-dbus is not executable everything seems to work correctly (I can mount and unmount the drive in Nautilus).
*KDE/Dolphin:
Everything seems to work fine even with 30-dbus executable, although in either case I've not managed to eject the virtual CD with Dolphin without force-unmounting it.
EDIT: the lines used in .xinitrc are:
exec ck-launch-session gnome-session
exec ck-launch-session startkde
Different DE have different requirements regarding ck* and the only sane way is to make no assumptions about the order of ck-launch-session and dbus-launch on users' behalf.
This is what my .xinitrc looks like (I use SLiM as a Login-Manager):
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done
unset f
fi
case $1 in
openbox)
exec openbox-session
;;
xfce4|*)
exec ck-launch-session dbus-launch startxfce4
;;
esac
EDIT: As the new SLiM v. 1.3.3 now supports Console/PolicyKit, the ck-launch-session command isn't required anymore and thus I do not experience any further problems concerning this 'bug'.
my current xfce line in .xinitrc looks like this:
exec startxfce4
So using a Console/PolicyKit capable Display Manager is also a possible solution.
I am also facing problem with mounting partitions.I was searching for this problem in forums but was not able to find any thread and than i came here.
I have gnome3.4 now.
When i click on partitions in nautilus,it says "Unable to mount program files \n Not authorized to perform operation"
Problem is not only while mounting partitions.
Wherever we need authorization .Like changing date and time ,changing user accounts using gnome UI etc.The unlock button is greyed out permanently.
even i am not able to shutdown using gnome menus. it just log out only.
i run gnome using daemon method. not through xinitrc
https://bbs.archlinux.org/viewtopic.php?id=141849
However consolekit can be replaced by simply using systemd (which has logind) and making sure X starts on the same tty as the display manager or getty.