-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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: add required argv0 to wrapper. #188108
Conversation
In cases where podman uses conmon it passes its own path as a command line argument in `--exit-command`. This exit command is used for container cleanup. For it to work the path must be the wrapper instead of the unwrapped executable. Without this change rootless podman runs can hang for 20 seconds before killing the container itself. The debug logs will show: Exceeded conmon timeout waiting for container ___ to exit
@@ -74,6 +74,7 @@ in runCommand podman.name { | |||
ln -s ${podman-unwrapped}/lib $out/lib | |||
ln -s ${podman-unwrapped}/share $out/share | |||
makeWrapper ${podman-unwrapped}/bin/podman $out/bin/podman \ | |||
--argv0 $out/bin/podman \ |
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.
Does this work?
--argv0 $out/bin/podman \ | |
--inherit-argv0 \ |
Result of 1 package built:
|
With more testing it seems this isn't generally working in Linux cases where |
@KenMacD did you find a better way to fix that? This issue is still present. |
Setting |
Sorry @dawidd6, I should have added another comment here. I ended up getting this PR applied upstream. As it's not released yet I've been using a local overlay for it (the filename changed upstream, so I didn't bother with self: super:
{
podman-unwrapped = super.podman-unwrapped.overrideAttrs (old: {
patches = (old.patches or []) ++ [
./add-path.patch
];
});
} With that patch simply being: diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go
index cb76de72c..261068082 100644
--- a/libpod/oci_conmon_linux.go
+++ b/libpod/oci_conmon_linux.go
@@ -1297,6 +1297,7 @@ func (r *ConmonOCIRuntime) configureConmonEnv(runtimeDir string) []string {
if ok {
env = append(env, fmt.Sprintf("CONTAINERS_CONF=%s", conf))
}
+ env = append(env, fmt.Sprintf("PATH=%s", os.Getenv("PATH")))
env = append(env, fmt.Sprintf("XDG_RUNTIME_DIR=%s", runtimeDir))
env = append(env, fmt.Sprintf("_CONTAINERS_USERNS_CONFIGURED=%s", os.Getenv("_CONTAINERS_USERNS_CONFIGURED")))
env = append(env, fmt.Sprintf("_CONTAINERS_ROOTLESS_UID=%s", os.Getenv("_CONTAINERS_ROOTLESS_UID"))) |
Thanks for the patch @KenMacD! |
Description of changes
In cases where podman uses conmon it passes its own path
as a command line argument in
--exit-command
. This exitcommand is used for container cleanup. For it to work the path
must be the wrapper instead of the unwrapped executable.
Without this change rootless podman runs can hang for 20 seconds
before killing the container itself. The debug logs will show:
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes