-
Notifications
You must be signed in to change notification settings - Fork 3k
Generate Systemd #2985
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
Generate Systemd #2985
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: baude The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
pkg/systemdgen/systemdgen.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested this config and I confirm it is what works the best for us in OpenStack.
EmilienM
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except the minor comment on the "stop" command, it looks good to me. Thanks for this work!
|
@baude Can you hit the |
|
I just put this PR up so I could get feedback from @EmilienM ... still lots of things to do. |
|
updated and removed the WIP |
docs/podman-generate-systemd.1.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the change in approach from the simpler example given in podman-run below? i.e., why a pid file and why not the -a option to podman start?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it all has to do with reliability and control of figuring out if the container dies.
|
More reliable way of tracking the actual container process - we've had
people report leaking processes when not using PID files
…On Mon, Apr 29, 2019, 07:43 James Cassell ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In docs/podman-generate-systemd.1.md
<#2985 (comment)>:
> +[Install]
+WantedBy=multi-user.target
+```
+
+Create a systemd unit file for a container running nginx with an *always* restart policy and 1-second timeout.
+```
+$ sudo podman generate systemd --restart-policy=always -t 1 nginx
+[Unit]
+Description=c21da63c4783be2ac2cd3487ef8d2ec15ee2a28f63dd8f145e3b05607f31cffc Podman Container
+[Service]
+Restart=always
+ExecStart=/usr/bin/podman start c21da63c4783be2ac2cd3487ef8d2ec15ee2a28f63dd8f145e3b05607f31cffc
+ExecStop=/usr/bin/podman stop -t 1 c21da63c4783be2ac2cd3487ef8d2ec15ee2a28f63dd8f145e3b05607f31cffc
+KillMode=none
+Type=forking
+PIDFile=/var/lib/containers/storage/overlay-containers/c21da63c4783be2ac2cd3487ef8d2ec15ee2a28f63dd8f145e3b05607f31cffc/userdata/c21da63c4783be2ac2cd3487ef8d2ec15ee2a28f63dd8f145e3b05607f31cffc.pid
Why the change in approach from the simpler example given in podman-run
below? i.e., why a pid file and why not the -a option to podman start?
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#2985 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB3AOCBJ5CYF7MOYDDFYQ3TPS3NOZANCNFSM4HHQGJ5Q>
.
|
|
I think it would be best if this was template based, that way users could specify a different template that they want to use. |
I dont know what you mean .... please elaborate. |
|
You hard coded a specific unit file format into the tool. I just want you to take that format, make it a template and then allow me to override it. Then if I want to setup different types of containers running in Unit files, I could do it. |
|
☔ The latest upstream changes (presumably #2982) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Two comments and a rebase and this ought to be good |
|
@baude Mind looking at this one? Needs a bit more work to make it in |
the podman generate systemd command will generate a systemd unit file based on the attributes of an existing container and user inputs. the command outputs the unit file to stdout for the user to copy or redirect. it is enabled for the remote client as well. users can set a restart policy as well as define a stop timeout override for the container. Signed-off-by: baude <bbaude@redhat.com>
|
/lgtm |
Signed-off-by: baude bbaude@redhat.com