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

Add podman-restart systemd unit file #10595

Merged
merged 1 commit into from
Jun 15, 2021
Merged

Add podman-restart systemd unit file #10595

merged 1 commit into from
Jun 15, 2021

Conversation

boaz0
Copy link
Collaborator

@boaz0 boaz0 commented Jun 8, 2021

closes #10539
closes #9579

@boaz0 boaz0 requested review from rhatdan and vrothberg June 8, 2021 06:38
contrib/systemd/system/podman-restart.service Outdated Show resolved Hide resolved
test/system/045-start.bats Outdated Show resolved Hide resolved
contrib/systemd/system/podman-restart.service Outdated Show resolved Hide resolved
Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

Code LGTM.

Any chance we could test the podman-restart.service in CI?

A simple test with podman create --restart=always --name foo, followed by a systemctl start podman-restart.service and then making sure foo is running should work (tested locally).

@lsm5 @jnovy PTAL for the packaging parts. Is there a way to enable the service by default in rpm?

@edsantiago
Copy link
Member

Any chance we could test the podman-restart.service in CI?

Not trivially, but it's doable. One will need to hand-copy the service file into the systemd directory, daemon-reload, etc etc. See test/system/2[57]*.bats for examples.

@boaz0
Copy link
Collaborator Author

boaz0 commented Jun 9, 2021

Now going to work on the tests for the unit file.

@rhatdan
Copy link
Member

rhatdan commented Jun 9, 2021

I am fine with getting this in without tests, for now. We can open a separate PR for tests. Would like to get this out to the world to test, since it has been requested for some time.

@nanonyme
Copy link

nanonyme commented Jun 9, 2021

Should this not require network or whatnot though? Or what makes this be scheduled late enough that started things won't immediately break?

@rhatdan
Copy link
Member

rhatdan commented Jun 9, 2021

Good point, it should probably be

[Install]
WantedBy=multi-user.target

We should add this to podman.service and add

[Install]
WantedBy=sockets.target

to podman.socket

@TomSweeneyRedHat
Copy link
Member

LGTM
once @rhatdan 's thoughts are addressed.

* Add podman-restart systemd unit file and add it to podman RPM package
* Fix podman start to filter all containers + unit test

Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
@boaz0
Copy link
Collaborator Author

boaz0 commented Jun 13, 2021

DONE @rhatdan @TomSweeneyRedHat

@TomSweeneyRedHat
Copy link
Member

LGTM

@rhatdan
Copy link
Member

rhatdan commented Jun 15, 2021

/lgtm
Thanks @boaz0

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 15, 2021
@rhatdan
Copy link
Member

rhatdan commented Jun 15, 2021

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 15, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: boaz0, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 15, 2021
@openshift-merge-robot openshift-merge-robot merged commit b422a4e into containers:master Jun 15, 2021
@boaz0 boaz0 deleted the closes_10539 branch June 16, 2021 08:39
@Aposhian
Copy link

Pardon if this is an ignorant comment, but doesn't adding

WantedBy=multi-user.target

to podman.service effectly make podman no longer "daemonless" as is commonly touted, if you compile with the systemd feature?

@vrothberg
Copy link
Member

As long as no other service "Requires" podman.service, it won't be started at boot. In the worst case of it being started at boot, it would shut down quickly when no incoming REST calls are detected.

@rhatdan
Copy link
Member

rhatdan commented Oct 15, 2021

@Aposhian Podman does not require a long running daemon to run. If apps like docker compose or docker-py or podman-py want to talk to a restapi to launch a service. We added options to podman system service to be able to service this API.

Podman will act as a socket activated service to launch containers for the API. You can run multiple of these services if you wanted to, and it runs rootless and rootfull. The service goes down within 5 seconds of the last connection. If you want to call this a daemon, then fine.
But that does not change the fact that Podman does not require a Daemon.

@github-actions 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 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
9 participants