GNOME Bugzilla – Bug 666787
Add optional systemd support
Last modified: 2012-01-23 15:00:32 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.
Created attachment 204160 [details] [review] Add an --enable-systemd option to configure
Created attachment 204161 [details] [review] Add a systemd implementation of GnomeSettingsSession
Created attachment 204162 [details] [review] Use systemd to shutdown if power runs low
Created attachment 204163 [details] [review] Use systemd to monitor session status in the automounter
Created attachment 204165 [details] [review] the power patch had some problems
Review of attachment 204160 [details] [review]: Copy/pasted magic looks fine to me.
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?
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.
Review of attachment 204165 [details] [review]: Looks good.
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.
New patch for GnomeSettingsSession uses ifdefs instead of separate sources, to reduce duplication.
Review of attachment 204655 [details] [review]: Looks good.
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 ?
(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.
Created attachment 205741 [details] [review] Add an --enable-systemd option to configure The SYSTEMD_CFLAGS and _LIBS will be used in the following commits.
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.
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.
Created attachment 205744 [details] [review] Use GnomeSettingsSession in the automounter This avoids duplicating the session monitor code in two places.
I've rebased the series against current master, and implemented a better solution for the automounter.
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