-
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
--sdnotify default value from the "podman create" man page is "container" but "conmon" is used when running "podman generate systemd ..." #15029
Comments
I believe that this is a deliberate change to generated unit files, and we will override any user-specified setting as well. I don't recall the reasoning for that, though. @vrothberg would know. |
I thought default value by definition meant that the option can be left out from the command-line whenever you need to specify that value. How it currently works does not match that. If I add --sdnotify=container I get another result. EditComparison of using --sdnotify=container and leaving it out
--- /tmp/without 2022-07-22 07:47:56.167326337 +0200
+++ /tmp/with 2022-07-22 07:47:31.798918966 +0200
@@ -1,6 +1,6 @@
# container-ctr.service
# autogenerated by Podman 4.1.1
-# Fri Jul 22 07:47:56 CEST 2022
+# Fri Jul 22 07:47:31 CEST 2022
[Unit]
Description=Podman container-ctr.service
@@ -18,11 +18,11 @@
--cidfile=%t/%n.ctr-id \
--cgroups=no-conmon \
--rm \
- --sdnotify=conmon \
-d \
--replace \
-q \
- --name ctr ghcr.io/eriksjolund/socket-activate-echo
+ --name ctr \
+ --sdnotify=container ghcr.io/eriksjolund/socket-activate-echo
ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id
Type=notify |
If the user created the container with @eriksjolund, shall we add that to the docs of |
I am impressed by the level of detail, @eriksjolund. Thanks for all the great contributions! |
Thanks @vrothberg! To me it seems conmon is currently the default value. Wouldn't the most proper fix be to set a container object datafield for this directly (when Currently it works like this
A sketch of how it could work instead (edited)
|
Oh, that is good news (and a sane default)! I didn't double-check in the code.
So you would enforce setting |
Yes, that is how it works right now. But there is currently no way to extract the value with the command
If there would be a datafield for sdnotify it would be possible to run something like
I think it would good to have such a command when supporting user questions in internet forums. I made an edit to #15029 (comment) regarding |
An easy fix for this issue would be to just change the documentation from Default is container, to Default is conmon, The other part, introducing |
SGTM! Interested in opening a PR? |
The current default in the code is container. The sdnotify socket always gets the MAINPID from conmon and the ready message should be send from the container. You can remove the |
At the moment I'm a bit too confused about how it works. (I thought conmon was the default but not anymore after reading the comment from @Luap99) |
I am less confused now :) As mentioned above, I thought the default was "container". @eriksjolund, should we improve the docs of |
@eriksjolund see test/system/260-sdnotify.bats for examples how the different modes work. But basically if |
I gave it a try, see linked PR. When doing that I noticed that the value ignore is mapped to conmon. |
I noticed
I created an issue for that |
@vrothberg PTAL |
* Document why the default value for --sdnotify is overridden. Some was included text from containers#15029 (comment) * Document that --sdnotify=ignore is overridden. Fixes containers#15029 Co-authored-by: Valentin Rothberg <[email protected]> Co-authored-by: Tom Sweeney <[email protected]> Signed-off-by: Erik Sjölund <[email protected]>
* Document why the default value for --sdnotify is overridden. Some was included text from containers#15029 (comment) * Document that --sdnotify=ignore is overridden. Fixes containers#15029 Co-authored-by: Valentin Rothberg <[email protected]> Co-authored-by: Tom Sweeney <[email protected]> Signed-off-by: Erik Sjölund <[email protected]>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
--sdnotify has the default value container according to the podman create man page but the value conmon is used instead when running
podman generate systemd ...
podman/docs/source/markdown/podman-create.1.md
Line 948 in 04ed519
Steps to reproduce the issue:
Describe the results you received:
Describe the results you expected:
If container is the default value, I would expect the result to be
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):The text was updated successfully, but these errors were encountered: