-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for systemd user services #1296
Comments
Should this be added to ignition? I see now that ignition has a "systemd" key, a |
I think this is the right place to add support. We currently have a workaround in the documentation: https://docs.fedoraproject.org/en-US/fedora-coreos/tutorial-user-systemd-unit-on-boot/ |
The scope is too limited as
|
https://github.com/containers/quadlet > This might be of help here. |
thanks @travier I came to this issue because I wanted to run ssh-agent service
created in It seems that your (@travier) link to quadlet doesn't handle this case ... I didn't try it before writing, you can blame me ^^ as far as I know butane (and ignition process) are creating units file in Let me know if i'm wrong |
Indeed, looks like this does not yet support user-level systemd services. That could be a nice future feature 🙂. |
From the IRC meeting: while this feature is eventually going to be exposed through a Butane config entry, the core logic does not need to live inside Butane as transpiler sugar. |
There seems to be some agreement and no known objections to implementing this directly in Ignition. I'll attempt to move this issue to that repository. |
@Nemric @JaimeMagiera FYI ^^ |
Allow users to create and enable user-level systemd services in ignition Fixes coreos#1296
Allow users to create and enable user-level systemd services in ignition Fixes coreos#1296
The current draft implementation in #1303 only handles systemwide user units in |
My expectation was the units would be written out under If they get written to If we flip that and write them to Maybe we should support both? Add a spec entry for user and if the user specifies it write it to |
I think this won't be so hard to support both, as my first need was running a user ssh-agent globally and @vilgotf wanted specific user services. |
There is a Systemd feature request for supporting ~/.config/systemd/user with a preset file Maybe such a feature would be useful when implementing support for If I understand correctly Ignition uses preset files for the system services. |
Allow users to create and enable user-level systemd services in ignition Fixes coreos#1296
It seems that units written in ~/.config/systemd/user are aware of /etc/systemd/user-preset/*.preset files my test : [Unit]
Description=A systemd user unit demo
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=/usr/bin/sleep infinity
[Install]
WantedBy=multi-user.target create /etc/systemd/user-preset/20-test.preset with I get ○ sleeper.service - A systemd user unit demo
Loaded: loaded (/var/home/core/.config/systemd/user/sleeper.service; disabled; vendor preset: enabled)
Active: inactive (dead) As you can see, vendor preset is set to enable I assume, for developments, that it will work as expected until I can dig deeper |
systemctl says the vendor preset is enabled because it sees the preset file, but that's no guarantee that systemd will actually apply that preset. You'll need to test this in an actual OS image. |
I'm using rootless podman containers when possible (configured with
podman generate systemd
) and having them always run by enabling linger on my account. Transitioning to a FCOS setup using fcct was easily possible, but I'm forced to use a awkward workaround.I use trees to import
~/.config/systemd/user
and then create a service on first boot that relabels~/
to the correct owner. My setup would be easier written using the systemd sugar in fcct if user-services were supported.The text was updated successfully, but these errors were encountered: