-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
podman generate systemd creates incorrect WantedBy for user services #5423
Labels
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
Comments
openshift-ci-robot
added
the
kind/bug
Categorizes issue or PR as related to a bug.
label
Mar 8, 2020
@vrothberg PTAL |
Thanks for opening the issue, @wdouglascampbell! I will have a look at it asap. |
vrothberg
added a commit
to vrothberg/libpod
that referenced
this issue
Mar 9, 2020
When enabling a systemd service we can specify which target will start it by specifying it in the `[INSTALL]` section. In case of root, this is commonly set to `multi-user.target` which is used to start other essential system services such as the network manager, D-BUS and more. However, the `multi-user.target` is not enough on all systems, especially when running rootless and enabling user services. Multiple users have reported issues that there isn't even an attempt to start the service. Setting the INSTALL target to `default.target` will fix the rootless case. However, `default.target` may vary among systems. Fedora Workstation, for instance, sets the `default.target` to the graphical target (i.e., runlevel 5) while Fedora Server sets it to `multi-user.target` which is on runlevel 2 and hence way earlier in the startup sequence. As INSTALL allows for specifying multiple INSTALL targets, we can set it to `multi-user.target` to continue supporting existing workloads AND to `default.target` which MAY redundantly attempt to start it at a later point; effectively a NOP for the root case and essential for rootless. Fixes: containers#5423 Signed-off-by: Valentin Rothberg <[email protected]>
Wonderful, thanks for testing! |
snj33v
pushed a commit
to snj33v/libpod
that referenced
this issue
May 31, 2020
When enabling a systemd service we can specify which target will start it by specifying it in the `[INSTALL]` section. In case of root, this is commonly set to `multi-user.target` which is used to start other essential system services such as the network manager, D-BUS and more. However, the `multi-user.target` is not enough on all systems, especially when running rootless and enabling user services. Multiple users have reported issues that there isn't even an attempt to start the service. Setting the INSTALL target to `default.target` will fix the rootless case. However, `default.target` may vary among systems. Fedora Workstation, for instance, sets the `default.target` to the graphical target (i.e., runlevel 5) while Fedora Server sets it to `multi-user.target` which is on runlevel 2 and hence way earlier in the startup sequence. As INSTALL allows for specifying multiple INSTALL targets, we can set it to `multi-user.target` to continue supporting existing workloads AND to `default.target` which MAY redundantly attempt to start it at a later point; effectively a NOP for the root case and essential for rootless. Fixes: containers#5423 Signed-off-by: Valentin Rothberg <[email protected]>
github-actions
bot
added
the
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
label
Sep 23, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
/kind bug
Description
I'm using podman to generate a systemd service file. I am planning to run the container rootless and use systemd to automatically start the container.
I have enabled linger.
Steps to reproduce the issue:
Describe the results you received:
No attempt was made to start the container on reboot.
Describe the results you expected:
Container start attempted on boot.
Additional information you deem important (e.g. issue happens only occasionally):
When I edit the container-postfix.service file and change WantedBy line from:
WantedBy=multi-user.target
to:
WantedBy=default.target
and reload the configuration, re-enable, etc and reboot the container runs on boot.
Referencing https://wiki.archlinux.org/index.php/Systemd/User#Writing_user_units it seems to indicate that User Service Unit files should have WantedBy=default.target
Should podman provide an option to specify how to generate the service file?
Output of
podman version
:Output of
podman info --debug
:Additional environment details (AWS, VirtualBox, physical, etc.):
VirtualBox, Fedora CoreOS
The text was updated successfully, but these errors were encountered: