! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Unable to mount/unmount shutdown/reboot when using startxfce4 from a tty
Status:
RESOLVED: WONTFIX
Product:
Xfce-utils
Component:
General

Comments

Description Mike Massonnet editbugs 2010-09-07 19:10:51 CEST
Created attachment 3113 
Launch-xfce4-session-with-ck-launch-session-and-dbus.patch

Patch is attached to fix the bug where logging with ck-launch-session restores the shutdown/reboot buttons but it doesn't allow you to mount/unmount devices.
Comment 1 Lionel Le Folgoc 2010-09-08 06:07:26 CEST
Hi,

I don't think this should be added to xfce-utils:master (maybe to xfce-utils:4.6). Xfce4-session 4.7 is already consolekit-enabled, so prepending ck-launch-session is useless and is likely to create issues (cf. http://bugzilla.xfce.org/show_bug.cgi?id=6684).
Comment 2 Yves-Alexis Perez editbugs 2010-09-08 07:13:15 CEST
And again, don't start consolekit (nor dbus) blindly, check if it's needed before.
Comment 3 Mike Massonnet editbugs 2010-09-08 07:49:19 CEST
Did you check the patch?

And did you read my post? Well looks like my mail didn't make it to the Xfce list.

8<------------------------
Hi Folk,

I did some digging on forums and found *the* answer[1] after one hour
of search (the album I was listening to is now over, sigh). Adding
ck-launch-session inside xinitrc is okish, but it is missing simply
dbus-launch. For the ones not having this problem, calling startxfce4
with ck-l-s revived the shutdown/reboot buttons from the logout dialog
(this change has been committed in xfce-utils:master already) but I
and some of you were still unable to mount/unmount with
gvfs-mount/Thunar.

This actually never occurs if you login through GDM, however I don't
want to figure the why and how now :) The solution is simple, within
$prefix/etc/xdg/xfce4/xinitrc the command to execute xfce4-session has
to be changed from this:

 ck-launch-session xfce4-session

to this:

 ck-launch-session dbus-launch --sh-syntax --exit-with-session xfce4-session

A patch for xfce-utils is attached on bug 6690[2].

[1] https://bbs.archlinux.org/viewtopic.php?pid=720323#p720323
[2] http://bugzilla.xfce.org/show_bug.cgi?id=6690

Kind Regards
--
Mike
Comment 4 Mike Massonnet editbugs 2010-09-08 07:51:35 CEST
I'm reading through bug 6684 now.
Comment 5 Mike Massonnet editbugs 2010-09-08 07:56:11 CEST
Well, it's a realy mess. Feel free to adopt this solution for 4.6 or close the bug.
Comment 6 Mike Massonnet editbugs 2010-09-08 20:02:33 CEST
Created attachment 3114 
0001-Launch-xfce4-session-with-ck-launch-session-and-dbus.patch

Patch is updated and should be included for Xfce 4.7 too. The "if" condition checks whether ck-l-s exists and that a session isn't already launched, so running it through GDM is safe.
Comment 7 Samuli Suominen 2010-09-09 13:48:04 CEST
(In reply to comment #6)
> Created an attachment (id=3114) [details]
> 0001-Launch-xfce4-session-with-ck-launch-session-and-dbus.patch
> 
> Patch is updated and should be included for Xfce 4.7 too. The "if" condition
> checks whether ck-l-s exists and that a session isn't already launched, so
> running it through GDM is safe.

I tried this patch together with:

http://git.xfce.org/xfce/xfce4-session/commit/?id=35c620aa3749581580e0917ff7c2db1c223564a8

And 'exec startxfce4' in .xinitrc, and then `startx`. I get:

Session4:
	unix-user = '1000'
	realname = '(null)'
	seat = 'Seat5'
	session-type = ''
	active = FALSE
	x11-display = ':0'
	x11-display-device = '/dev/tty7'
	display-device = '/dev/tty1'
	remote-host-name = ''
	is-local = FALSE
	on-since = '2010-09-09T13:45:18.726130Z'
	login-session-id = '4294967295'

active is FALSE and is-local is FALSE and nothing working, no suspend/hibernate on xfce4-power-manager for instance.

*I'm lost.*
Comment 8 Samuli Suominen 2010-09-09 19:41:12 CEST
(In reply to comment #7)
> (In reply to comment #6)
> > Created an attachment (id=3114) [details] [details]
> > 0001-Launch-xfce4-session-with-ck-launch-session-and-dbus.patch
> > 
> > Patch is updated and should be included for Xfce 4.7 too. The "if" condition
> > checks whether ck-l-s exists and that a session isn't already launched, so
> > running it through GDM is safe.
> 
> I tried this patch together with:
> 
> http://git.xfce.org/xfce/xfce4-session/commit/?id=35c620aa3749581580e0917ff7c2db1c223564a8
> 
> And 'exec startxfce4' in .xinitrc, and then `startx`. I get:
> 
> Session4:
>     unix-user = '1000'
>     realname = '(null)'
>     seat = 'Seat5'
>     session-type = ''
>     active = FALSE
>     x11-display = ':0'
>     x11-display-device = '/dev/tty7'
>     display-device = '/dev/tty1'
>     remote-host-name = ''
>     is-local = FALSE
>     on-since = '2010-09-09T13:45:18.726130Z'
>     login-session-id = '4294967295'
> 
> active is FALSE and is-local is FALSE and nothing working, no suspend/hibernate
> on xfce4-power-manager for instance.
> 
> *I'm lost.*

Please ignore this statement.  I found the culprit to be consolekit-0.4.2 that I just had bumped. Reverting to consolekit-0.4.1 restored the functionality. 
Has nothing to do with this bug. 
Sorry about the noise!
Comment 9 Samuli Suominen 2010-09-10 07:25:54 CEST
The attached patch works like a charm. The "Not authorized." problem with new Thunar is gone.

And like said, ignore my previous statements, it was unrelated to this issue.

Thanks Mike!
Comment 10 Samuli Suominen 2010-10-28 18:35:00 CEST
Since ConsoleKit 0.4.2 this patch isn't required for me anymore, it's best if xfce-utils doesn't mess with ck-launch-session at all. 'NAK'.
Comment 11 Samuli Suominen 2010-10-28 19:23:17 CEST
This is from /etc/X11/Sessions/Gnome:

# run all system xinitrc shell scripts.
if [ -d /etc/X11/xinit/xinitrc.d ]; then
    for i in /etc/X11/xinit/xinitrc.d/* ; do
        if [ -x "$i" ]; then
            . "$i"
        fi
    done
fi

This is from /etc/X11/xinit/xinitrc:

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
        for f in /etc/X11/xinit/xinitrc.d/* ; do
                [ -x "$f" ] && . "$f"
        done
        unset f
fi

Shouldn't /etc/xdg/xfce4/xinitrc have same?

In Gentoo, 90-consolekit is installed at /etc/X11/xinit/xinitrc.d which does the checking of $GDMSESSION, $XDG_SESSION_COOKIE, $CK_LAUNCH_SESSION and so forth and sets command="$CK_LAUNCH_SESSION $command".   I know Debian/Ubuntu has similar file. Then there's also 80-dbus which does the dbus-launch.

I think that alone would allow plain startxfce4 to work with dbus and CK.
Comment 12 Jannis Pohlmann editbugs 2010-11-13 13:05:51 CET
So you mean we should simplify our xinitrc and let it run system-wide scripts from /etc/X111/xinit/xinitrc.d/. These scripts cover some of the functionality available in xinitrc. This way we wouldn't have to implement those bits on our own, right?

I too think we shouldn't mess with ConsoleKit AT ALL. The ConsoleKit folks have told me that we should do nothing like ck-launch-session or anything else. But maybe our init script still needs to be updated to work with these new frameworks in the desktop stack.
Comment 13 Nick Schermer editbugs 2014-12-03 09:19:29 CET
Close bug reports of archived products.

Bug #6690

Reported by:
Mike Massonnet
Reported on: 2010-09-07
Last modified on: 2014-12-03

People

Assignee:
Xfce Bug Triage
CC List:
4 users

Version

Version:
Unspecified

Attachments

Additional information