! 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 !
Missing LOGIND_RUNNING() check
Status:
RESOLVED: FIXED
Product:
Xfce4-power-manager
Component:
General

Comments

Description Dima Krasner 2015-02-21 16:48:10 CET
Created attachment 5975 
An experimental patch from Devuan

xfpm_manager_inhibit_sleep_systemd() is called upon successful connection to the system bus, without checking whether logind is running first. This LOGIND_RUNNING() call is missing in both xfpm_manager_inhibit_sleep_systemd() calls, so I put it inside the function.

This issue makes logind a mandatory dependency, in both 1.4.x and HEAD.
Comment 1 Simon Steinbeiss editbugs 2015-02-21 19:14:22 CET
Hi, first of all thanks for contributing a patch!
Currently systemd is optional and we want to keep it that way, so the patch definitely cannot be merged as is.

However, I'm wondering what your setup is like that this sort of check is needed. The compile option for systemd is for distributors mostly who also decide about the system's init system. So if system is used in the distro, I would expect them to compile xfpm accordingly.
If a distro uses something else, well then I presume they won't build xfpm with systemd support.

If a users switches from the distributor's init system to one of his choice, I would expect him to re-compile all relates apps too.

Or am I missing something? (Admittedly I don't know much about Devuan's setup.)
Comment 2 Dima Krasner 2015-02-21 20:56:47 CET
Correct me if I'm wrong - xfce4-power-manager does not have a compile-time switch that disables logind support. The detection of logind happens at runtime.

In Devuan's setup, we have logind (with sysvinit) and wish to make this dependency optional, considering the fact the only reason why xfce4-power-manager depends on logind is an Inhibit() call, used to *disable* its power management features.

The patch does not disable logind support; instead, it makes xfce4-power-manager check whether logind is running before it tries to call Inhibit(). Instead of checking whether the system bus is present, it should check "(the system bus is present) && (logind is running)".
Comment 3 Simon Steinbeiss editbugs 2015-02-21 22:04:37 CET
You're right, I mixed that up with polkit.

So without the check you add in your patch you get a dependency on logind for xfpm? (Sorry if I still haven't really understood that part of the issue.)

In which case would the system bus be present but logind not running?
Comment 4 Dima Krasner 2015-02-21 22:22:37 CET
> So without the check you add in your patch you get a dependency on logind for xfpm? (Sorry if I still haven't really understood that part of the issue.)

Yes. Without it, xfce4-power-manager calls logind's Inhibit() when it runs on a system with sysvinit and without logind.

The logind-related code was introdocued in 1.4.x. Just wondering - has anyone ever used it on a 100% clean system, with ConsoleKit and without systemd?

> In which case would the system bus be present but logind not running?

With any distro that has sysvinit, D-Bus and systemd-shim, without logind.
Comment 5 Eric Koegel editbugs 2015-02-27 18:34:53 CET
Thanks indeed for the patch, haven't done
a lot of testing with that particular setup. Since
the check is used in a dozen other places and the
lid inhibit is only useful for logind, I pushed
it to master.

commit 62c6acdc80d3afd78a485b01a49ff5369fcadd9b
Author: Dima Krasner <dima@dimakrasner.com>
Date:   Sat Feb 21 14:41:17 2015 +0200

    Bug fix - do not attempt to call Inhibit() if logind isn't running.
    
    Signed-off-by: Eric Koegel <eric.koegel@gmail.com>
http://git.xfce.org/xfce/xfce4-power-manager/commit/?id=62c6acdc80d3afd78a485b01a49ff5369fcadd9b

Bug #11574

Reported by:
Dima Krasner
Reported on: 2015-02-21
Last modified on: 2015-02-27

People

Assignee:
Ali Abdallah
CC List:
4 users

Version

Attachments

An experimental patch from Devuan (800 bytes, patch)
2015-02-21 16:48 CET , Dima Krasner
no flags

Additional information