Skip to content

Conversation

jakecorrenti
Copy link
Member

@jakecorrenti jakecorrenti commented Aug 29, 2025

Add a new --pidfile option. This will allow the user to specify a path in which the krunkit binary will write its PID.

Resolves: #42

@jakecorrenti jakecorrenti force-pushed the pidfile branch 2 times, most recently from 72d73c2 to 3a7e4ab Compare August 29, 2025 19:20
@jakecorrenti
Copy link
Member Author

jakecorrenti commented Aug 29, 2025

I wonder if this may work better as a PR in libkrun first, which we can then expose here in krunkit after. There's a possible scenario where you create the pidfile, something fails in krun_start_enter, and there's that short period of time where there's a pidfile that exists even though the guest hasn't started yet and we haven't had a chance to remove it on krun_start_enter failure.

@nirs
Copy link

nirs commented Aug 29, 2025

I wonder if this may work better as a PR in libkrun first, which we can then expose here in krunkit after. There's a possible scenario where you create the pidfile, something fails in krun_start_enter, and there's that short period of time where there's a pidfile that exists even though the guest hasn't started yet and we haven't had a chance to remove it on krun_start_enter failure.

This is very unlikely and the window is small. I think creating it before starting is good enough and it matches what vfkit does.

Programs running krunkit should check if the process terminated when they wait until the vm is reachable. I already do this in vment-helper test script, implementing this in minikube is easy.

@jakecorrenti jakecorrenti marked this pull request as ready for review August 30, 2025 00:35
@jakecorrenti jakecorrenti changed the title WIP: cmdline: context: add --pidfile option cmdline: context: add --pidfile option Aug 30, 2025
@jakecorrenti jakecorrenti marked this pull request as draft August 30, 2025 02:02
Add a new --pidfile option. This will allow the user to specify a path
in which the krunkit binary will write its PID.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
@jakecorrenti jakecorrenti marked this pull request as ready for review September 2, 2025 15:04
Copy link
Collaborator

@slp slp left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

@slp slp merged commit 6c3b1a2 into containers:main Sep 3, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Support] support pid file
3 participants