Skip to content
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

issues restarting or stopping systemd service pods #4

Open
creich opened this issue Dec 13, 2019 · 5 comments
Open

issues restarting or stopping systemd service pods #4

creich opened this issue Dec 13, 2019 · 5 comments

Comments

@creich
Copy link

creich commented Dec 13, 2019

due to my tests i encountered several issues using the generated systemd service.
e.g. trying to restart brought the service into the following status:

$ systemctl restart lighttpd-container-pod.service
$ systemctl status lighttpd-container-pod.service
● lighttpd-container-pod.service - lighttpd Podman Container
   Loaded: loaded (/etc/systemd/system/lighttpd-container-pod.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2019-12-13 14:10:38 EST; 2s ago
  Process: 5639 ExecStop=/usr/bin/podman stop lighttpd (code=exited, status=125)
  Process: 5671 ExecStartPre=/usr/bin/podman rm lighttpd (code=exited, status=1/FAILURE)
 Main PID: 5723 (podman)
creich pushed a commit to creich/podman-container-systemd that referenced this issue Dec 13, 2019
@ikke-t
Copy link
Owner

ikke-t commented Dec 15, 2019

Hmmm, my podman version 1.4.2-stable2 does not have such -i option. Need to take another look later.

@creich
Copy link
Author

creich commented Jan 14, 2020

i am using podman 1.7.0 atm.
question is, if we should fix it for the lower versions as well and if we do that, how we want to split those solutions. i found the -i option very lean and guess that fixing it another way might become more code.

any preferences on your side?

@ikke-t
Copy link
Owner

ikke-t commented Jan 14, 2020

Sorry it took time to come back to this, thanks for your patience. There has been a lot of traveling in between.

I don't see the problem there. I especially used the minus on those fields (=-) to let systemd ignore if the command throws an error. Sure, journalctl will have failed exec code for the line, but it ignores the error. Adding the -i option would lead to same state, right? Only difference that podman would ignore the error. Or am I missing something?

I would be OK to have the -i switch there preferrably once RHEL/CentOS operating systems will have such version of podman that has it. It can't be too long. But is there any benefit seeing the trouble for the time being?

See the "Table 1. Special executable prefixes" on this page, and look for the - operand: https://www.freedesktop.org/software/systemd/man/systemd.service.html

If the executable path is prefixed with "-", an exit code of the command normally considered a failure (i.e. non-zero exit status or abnormal exit due to signal) is recorded, but has no further effect and is considered equivalent to success.

Perhaps I didn't understand the problem?

@ikke-t
Copy link
Owner

ikke-t commented Jan 14, 2020

This is the line that you should be looking into, and it's just fine:

Active: active (running)

@jaywryan
Copy link

jaywryan commented Sep 1, 2020

I ran into similar problems and I have made some fixes, I'm not sure that these would be worth having upstream or not. I was trying to run rootless and the systemd unit file was not working as expected and wasn't able to start or stop the pods successfully as the PIDs were not owned by system. I will submit a pull request for the changes I made to help fix this, but I'm not sure if my changes may be breaking or not.

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

No branches or pull requests

3 participants