Created attachment 5031
logind/consolekit runtime detection patch
There is a general consensus (especially in the GNOME world) that before dropping any support for consolekit, both consolekit and logind should be detected at runtime.
This helps distributions planning to gently migrate from consolekit to logind to roll out a reliable path: enable logind support, have all the packages detect consolekit/logind at runtime, eventually migrate to logind reducing the risk of breaking current installations.
The patch I am proposing is exactly doing this, the same way GNOME does: have xfce4-session detect logind at runtime if --enable-systemd is passed to ./configure.
The attached patch is being currently tested in Sabayon and Gentoo (it's available on the systemd-love Portage overlay).
can someone comment on this?
I've tried this patch on top of 4.11 (which includes the “static” systemd support).
Patch applies fine and compile fine, but at runtime we still have a problem, actually, on systems where systemd-logind is running but systemd is not pid 1 (which is possible on logind < 204 and is a target goal in Ubuntu and maybe Debian). In that case, xfce4-session will prefer logind/systemd over consolekit/upower, but it'll fail to suspend.
I'm not sure if there's a way to actually fix that, maybe systemd-shim will help.
(In reply to Yves-Alexis Perez from comment #2)
> I'm not sure if there's a way to actually fix that, maybe systemd-shim will
So, it seems that it does help, so we have at least some kind of workaround.
Seems like this bug should be adapted to work of bug 9952, or maybe closed
It seems that this current patch unfortunately doesn't handle logind beeing restarted (for example after a logind upgrade). That means that hardware-dependent features (shutdown/reboot etc.) are not supported after an upgrade, the user needs to restart the session.
More info at http://bugs.debian.org/752744
Actually, I take that back, that's only with 4.10 without the patch that the problem occurs, which makes sense anyway.
Something similar to this proposed patch was pushed in http://git.xfce.org/xfce/xfce4-session/commit/?id=0bc5eb603a3ab4af930fac70e03cfe7aa63a399e
Marking this bug resolved.