Skip to content

Add systemd support#55

Merged
tintou merged 1 commit intomasterfrom
systemd-units
Jun 10, 2022
Merged

Add systemd support#55
tintou merged 1 commit intomasterfrom
systemd-units

Conversation

@davidmhewitt
Copy link
Member

@davidmhewitt davidmhewitt commented Sep 19, 2021

Adds the necessary unit files to be able to launch Pantheon via gnome-session's systemd support.

Merging this will have no effect on the current way of launching the session, just prepares us for removing the --builtin flag on the session in the future.

This can be tested in conjunction with elementary/gala#1256 and elementary/gala#1255 . If you remove the --builtin flag from /usr/share/xsessions/pantheon.desktop, gnome-session will launch Pantheon using the systemd units instead of the XDG autostarts.

@davidmhewitt
Copy link
Member Author

@bobby285271 can you have a look at this?

We seem to have nix packaging in-tree here and I've broken it 😅

This PR adds some systemd user units that along with some changes to gala (and probably some other components) will resolve #17

I think pantheon elementary OS 6.0 will still continue to use the --builtin flag on gnome-session (i.e. it won't use these systemd units and use XDG autostarts and the builtin session mangement in gnome-session instead), but there's no harm in installing these in preparation for the future. Or you could just disable them with the meson option for now.

@bobby285271
Copy link
Member

bobby285271 commented Sep 19, 2021

https://github.com/bobby285271/session-settings/actions/runs/1250907248
bobby285271@9f1aa21

This should be the minimal change to make CI pass, though I was not able to nix-build this locally now (due to NixOS/nixpkgs#108938 I think). I think systemd should probably be put in buildInputs, ping @davidak for some review :-)

@davidmhewitt
Copy link
Member Author

@bobby285271 Thanks, I've made those changes. I've never done anything with nix packaging before, so if you and @davidak are happy, I'm happy. There's a relevant issue about this change in NixOS here: NixOS/nixpkgs#101817

@davidak
Copy link

davidak commented Sep 20, 2021

I see no problem, but i'm also no expert with session management.

@davidmhewitt
Copy link
Member Author

That's OK, I'll handle testing the session management stuff, just wanted to check the nix packaging files still look good!

@davidmhewitt davidmhewitt requested a review from a team September 29, 2021 16:42
JoseExposito
JoseExposito previously approved these changes Sep 29, 2021
Copy link
Member

@JoseExposito JoseExposito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not an expert, but from my limited experience on the topic, it looks good. I'd appreciate if someone else could look at it as well.

# Start happens explicitly
RefuseManualStart=no
# Stop happens by starting gnome-session-shutdown.target
#RefuseManualStop=yes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove this comments before merging?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These unit files are just direct copies of the ones from gnome-session, just tweaked where necessary to make it run pantheon instead and these lines come from there. It seems nicer to keep them as similar as possible to the gnome-session ones so we can see the diff if necessary.

@davidak
Copy link

davidak commented Dec 2, 2021

I tested this on NixOS without issues. NixOS/nixpkgs#140429 (comment)

We will merge it into our unstable release when this PR is merged.

When do you plan to merge this PR?

@davidmhewitt davidmhewitt requested a review from a team December 8, 2021 14:39
@bobby285271
Copy link
Member

Just for information, we later found some issues with --builtin removed like hotkeys for screenshot, keyboard keys for volume up, down and mute, night light no longer works. But yeah this PR does not actually do the switch so should be fine.

@davidmhewitt
Copy link
Member Author

Just for information, we later found some issues with --builtin removed like hotkeys for screenshot, keyboard keys for volume up, down and mute, night light no longer works. But yeah this PR does not actually do the switch so should be fine.

That sounds like the various GSD components aren't starting as dependencies, did you find the source of the issue?

@bobby285271
Copy link
Member

bobby285271 commented Jan 7, 2022

That sounds like the various GSD components aren't starting as dependencies, did you find the source of the issue?

Just updated the downstream PR to include the workaround: NixOS/nixpkgs#140429 (comment), maybe we need something like /etc/systemd/user/[email protected]/gnome.session.conf for [email protected]. 😿

Details
[Unit]
# Must be in sync with gnome.session
Wants=org.gnome.SettingsDaemon.A11ySettings.target
Wants=org.gnome.SettingsDaemon.Color.target
Wants=org.gnome.SettingsDaemon.Datetime.target
Wants=org.gnome.SettingsDaemon.Housekeeping.target
Wants=org.gnome.SettingsDaemon.Keyboard.target
Wants=org.gnome.SettingsDaemon.MediaKeys.target
Wants=org.gnome.SettingsDaemon.Power.target
Wants=org.gnome.SettingsDaemon.PrintNotifications.target
Wants=org.gnome.SettingsDaemon.Rfkill.target
Wants=org.gnome.SettingsDaemon.ScreensaverProxy.target
Wants=org.gnome.SettingsDaemon.Sharing.target
Wants=org.gnome.SettingsDaemon.Smartcard.target
Wants=org.gnome.SettingsDaemon.Sound.target
Wants=org.gnome.SettingsDaemon.UsbProtection.target
Wants=org.gnome.SettingsDaemon.Wacom.target
Wants=org.gnome.SettingsDaemon.XSettings.target

@tintou tintou merged commit ea1566a into master Jun 10, 2022
@tintou tintou deleted the systemd-units branch June 10, 2022 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants