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 666787 - Add optional systemd support
Add optional systemd support
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks: systemd
 
 
Reported: 2011-12-24 04:40 UTC by Matthias Clasen
Modified: 2012-01-23 15:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add an --enable-systemd option to configure (1.71 KB, patch)
2011-12-24 04:41 UTC, Matthias Clasen
accepted-commit_now Details | Review
Add a systemd implementation of GnomeSettingsSession (10.01 KB, patch)
2011-12-24 04:42 UTC, Matthias Clasen
reviewed Details | Review
Use systemd to shutdown if power runs low (2.75 KB, patch)
2011-12-24 04:43 UTC, Matthias Clasen
none Details | Review
Use systemd to monitor session status in the automounter (5.93 KB, patch)
2011-12-24 04:44 UTC, Matthias Clasen
reviewed Details | Review
the power patch had some problems (2.75 KB, patch)
2011-12-24 06:29 UTC, Matthias Clasen
accepted-commit_now Details | Review
Add a systemd implementation of GnomeSettingsSession (7.72 KB, patch)
2012-01-05 03:22 UTC, Matthias Clasen
accepted-commit_now Details | Review
Add an --enable-systemd option to configure (1.87 KB, patch)
2012-01-21 02:19 UTC, Matthias Clasen
committed Details | Review
Add a systemd implementation of GnomeSettingsSession (7.43 KB, patch)
2012-01-21 02:19 UTC, Matthias Clasen
committed Details | Review
Use systemd to shutdown if power runs low (2.80 KB, patch)
2012-01-21 02:19 UTC, Matthias Clasen
committed Details | Review
Use GnomeSettingsSession in the automounter (9.38 KB, patch)
2012-01-21 02:19 UTC, Matthias Clasen
committed Details | Review

Description Matthias Clasen 2011-12-24 04:40:16 UTC
ConsoleKit is being phased out on systemd-using systems.
Here is a series of patches that adds systemd implementations for the various
ConsoleKit uses in g-s-d.
Comment 1 Matthias Clasen 2011-12-24 04:41:41 UTC
Created attachment 204160 [details] [review]
Add an --enable-systemd option to configure
Comment 2 Matthias Clasen 2011-12-24 04:42:25 UTC
Created attachment 204161 [details] [review]
Add a systemd implementation of GnomeSettingsSession
Comment 3 Matthias Clasen 2011-12-24 04:43:36 UTC
Created attachment 204162 [details] [review]
Use systemd to shutdown if power runs low
Comment 4 Matthias Clasen 2011-12-24 04:44:21 UTC
Created attachment 204163 [details] [review]
Use systemd to monitor session status in the automounter
Comment 5 Matthias Clasen 2011-12-24 06:29:01 UTC
Created attachment 204165 [details] [review]
the power patch had some problems
Comment 6 Bastien Nocera 2011-12-30 23:57:13 UTC
Review of attachment 204160 [details] [review]:

Copy/pasted magic looks fine to me.
Comment 7 Bastien Nocera 2011-12-30 23:58:34 UTC
Review of attachment 204161 [details] [review]:

A lot of duped code between the two implementations. Isn't there a cleaner way to share that code?
Comment 8 Bastien Nocera 2011-12-31 00:00:06 UTC
Review of attachment 204163 [details] [review]:

We really want a little helper object here. Poking directly at systemd with an fd isn't good enough. It even looks like the unique code in the systemd.c piece of code for the daemon itself.
Comment 9 Bastien Nocera 2011-12-31 00:00:44 UTC
Review of attachment 204165 [details] [review]:

Looks good.
Comment 10 Matthias Clasen 2012-01-05 03:22:55 UTC
Created attachment 204655 [details] [review]
Add a systemd implementation of GnomeSettingsSession

This implementation uses the logind apis for tracking active sessions
instead of ConsoleKit. It is only compiled if --enable-systemd is
passed to configure, otherwise the ConsoleKit implementation is
used.
Comment 11 Matthias Clasen 2012-01-05 03:24:03 UTC
New patch for GnomeSettingsSession uses ifdefs instead of separate sources, to reduce duplication.
Comment 12 Bastien Nocera 2012-01-06 11:19:19 UTC
Review of attachment 204655 [details] [review]:

Looks good.
Comment 13 Matthias Clasen 2012-01-06 16:29:36 UTC
So, you want me to move the GSource implementation into a separate source file, and compile that both into the daemon and the automount helper ?
Comment 14 Bastien Nocera 2012-01-06 16:48:20 UTC
(In reply to comment #13)
> So, you want me to move the GSource implementation into a separate source file,
> and compile that both into the daemon and the automount helper ?

I'd really like not to see something as ugly in the automount helper (especially as we might end up having other plugins needing that functionality too). An object with signals would be my preferred route.
Comment 15 Matthias Clasen 2012-01-21 02:19:47 UTC
Created attachment 205741 [details] [review]
Add an --enable-systemd option to configure

The SYSTEMD_CFLAGS and _LIBS will be used in the following
commits.
Comment 16 Matthias Clasen 2012-01-21 02:19:50 UTC
Created attachment 205742 [details] [review]
Add a systemd implementation of GnomeSettingsSession

This implementation uses the logind apis for tracking active sessions
instead of ConsoleKit. It is only compiled if --enable-systemd is
passed to configure, otherwise the ConsoleKit implementation is
used.
Comment 17 Matthias Clasen 2012-01-21 02:19:53 UTC
Created attachment 205743 [details] [review]
Use systemd to shutdown if power runs low

When --enable-systemd is passed to configure, talk to logind
instead of ConsoleKit to power the machine off.
Comment 18 Matthias Clasen 2012-01-21 02:19:55 UTC
Created attachment 205744 [details] [review]
Use GnomeSettingsSession in the automounter

This avoids duplicating the session monitor code in two places.
Comment 19 Matthias Clasen 2012-01-21 02:21:30 UTC
I've rebased the series against current master, and implemented a better solution for the automounter.
Comment 20 Bastien Nocera 2012-01-23 15:00:20 UTC
Attachment 205741 [details] pushed as 4f97b64 - Add an --enable-systemd option to configure
Attachment 205742 [details] pushed as 48b52b0 - Add a systemd implementation of GnomeSettingsSession
Attachment 205743 [details] pushed as bdc1a64 - Use systemd to shutdown if power runs low
Attachment 205744 [details] pushed as af47884 - Use GnomeSettingsSession in the automounter