After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 696264 - checks for systemd, not for logind
checks for systemd, not for logind
Status: RESOLVED FIXED
Product: gnome-screensaver
Classification: Deprecated
Component: general
3.6.x
Other Linux
: Normal minor
: ---
Assigned To: gnome-screensaver maintainers
gnome-screensaver maintainers
Depends on:
Blocks:
 
 
Reported: 2013-03-21 10:25 UTC by Martin Pitt
Modified: 2013-03-21 15:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Check for logind, not for systemd (1.93 KB, patch)
2013-03-21 10:26 UTC, Martin Pitt
committed Details | Review

Description Martin Pitt 2013-03-21 10:25:50 UTC
gnome-screensaver wants to talk to logind, but actually checks for systemd. It is
possible to build systemd without logind, in which case /sys/fs/cgroup/systemd
would still exist. For that reason, sd_booted() was recently fixed upstream to
only be true if systemd init is active [1].

For running systemd init without logind, or for running logind without systemd
init we need to change the check to test for logind.

For details, see [2] if you are interested.

[1] http://cgit.freedesktop.org/systemd/systemd/commit/?id=66e411811b8090
[2] https://mail.gnome.org/archives/desktop-devel-list/2013-March/msg00092.html
Comment 1 Martin Pitt 2013-03-21 10:26:46 UTC
Created attachment 239448 [details] [review]
Check for logind, not for systemd
Comment 2 Ray Strode [halfline] 2013-03-21 12:37:30 UTC
i don't completely understand. your patch does:

+        listener->priv->have_systemd = (access("/run/systemd/seats/", F_OK) >= 0);

and the patch you pointed out does:

- if (lstat("/sys/fs/cgroup/systemd", &b) < 0)
+ if (lstat("/run/systemd/system/", &st) < 0)
return 0;
- return a.st_dev != b.st_dev;
+ return !!S_ISDIR(st.st_mode);

So isn't your patch essentially doing what sd_booted() does now?
Comment 3 Martin Pitt 2013-03-21 12:54:53 UTC
Not quite. /run/systemd/system is the indicator for "booted with systemd", while /run/systemd/seats/ is the indicator for "logind is running". Lennart's reply at the bottom of https://mail.gnome.org/archives/desktop-devel-list/2013-March/msg00092.html has the details.
Comment 4 Ray Strode [halfline] 2013-03-21 15:32:35 UTC
ah okay. feel free to push this, but i wonder if we could get sd_login api added
Comment 5 Martin Pitt 2013-03-21 15:52:04 UTC
I did ask Lennart about it, but he wasn't very enthusiastic about it. Also, it would require a version check in configure.ac, and either require systemd >= 199, or have a fallback for older versions.