Skip to content

fix: write runtime pidfile when provided#439

Open
sidneychang wants to merge 1 commit intourunc-dev:mainfrom
sidneychang:check-urunc-podman
Open

fix: write runtime pidfile when provided#439
sidneychang wants to merge 1 commit intourunc-dev:mainfrom
sidneychang:check-urunc-podman

Conversation

@sidneychang
Copy link
Contributor

@sidneychang sidneychang commented Feb 3, 2026

Ensure the PID is written to the runtime-provided --pid-file after container creation. This allows supervisors like conmon to track and reap the container process correctly, preventing early cleanup or EOF failures. This change also ensures that Podman can reliably start urunc containers.

Description

In the current code, there is a --pid-file flag, but in reality, we are not actually writing to the specified pid-file. This causes issues when starting urunc with Podman, preventing it from starting properly.

Related issues

#114

How was this tested?

  • Configure Podman to Use urunc
    I tested using the method described in Check integration of urunc with podman #114 and configured Podman to use urunc as the runtime. I executed the following command to modify the Podman container configuration:
sudo tee /etc/containers/containers.conf >/dev/null <<EOT
[engine]
runtime = "/usr/local/bin/urunc"
EOT
  • Configure the QEMU Path for urunc
    To ensure urunc can locate the QEMU binary, the QEMU path needs to be set in the config.toml file for urunc. The configuration should look like this:
[monitors.qemu]
path = "/usr/bin/qemu-system-x86_64"

Run urunc with Podman
After configuring the runtime and QEMU path, I attempted to run the urunc container using Podman:

podman run --rm -d harbor.nbfc.io/nubificus/urunc/nginx-qemu-unikraft-initrd:latest

result:
image

LLM usage

Using Codex to debug the cause of the issue#114

Checklist

  • I have read the contribution guide.
  • The linter passes locally (make lint).
  • The e2e tests of at least one tool pass locally (make test_ctr, make test_nerdctl, make test_docker, make test_crictl).
  • If LLMs were used: I have read the llm policy.

@netlify
Copy link

netlify bot commented Feb 3, 2026

Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit 9622e2a
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/69845e08ddeeb10008b3fcb7

Ensure the PID is written to the runtime-provided --pid-file after
container creation. This allows supervisors like `conmon` to track and
reap the container process correctly, preventing early cleanup or EOF
failures. This change also ensures that Podman can reliably start urunc
containers.

Signed-off-by: sidneychang <2190206983@qq.com>
Copy link
Contributor

@cmainas cmainas left a comment

Choose a reason for hiding this comment

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

Thank you a lot @sidneychang for this fix!

I think we can make the patch even smaller. We can simply add the pid file apth as an extra argument in unikontainers.Create https://github.com/sidneychang/urunc/blob/9622e2a938b1a911f176eee2d6a0fa00e92ae09b/cmd/urunc/create.go#L257

Inside Create if the pid file path is not specified we can simply use the default value otherwise the argument passed.

@sidneychang
Copy link
Contributor Author

Thank you a lot @sidneychang for this fix!

I think we can make the patch even smaller. We can simply add the pid file apth as an extra argument in unikontainers.Create https://github.com/sidneychang/urunc/blob/9622e2a938b1a911f176eee2d6a0fa00e92ae09b/cmd/urunc/create.go#L257

Inside Create if the pid file path is not specified we can simply use the default value otherwise the argument passed.

I agree with this approach, and I actually considered something similar. My only hesitation was whether we still need to always write the pid file to the existing default path filepath.Join(u.State.Bundle, initPidFilename), or if, once an explicit pid file path is provided, we should skip writing to the default location entirely and only write to the provided path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check integration of urunc with podman

2 participants