Replies: 2 comments
-
It would be a trivial change to just add a CLI argument to the jailer or to firecracker binary itself that would output wait status into |
Beta Was this translation helpful? Give feedback.
-
I found an interesting way to do this:
This procfs approach seems to work accurately since this pseudo-init process, after its death, becomes a zombie process i.e. it's still registered within procfs and its exit status can be fetched from there. I am reasonably satisfied with this solution and implemented it here, but I'd like to get some input on its correctness or possible alternatives from the jailer team since, so far, I haven't found any? |
Beta Was this translation helpful? Give feedback.
-
Currently working on adding support for both jailer daemonization and separate pid namespaces to fctools and hit a major roadblock.
To support both child processes and non-children like what the jailer creates, I made an enum
ProcessHandle
wrapper with either a properly controlled tokioChild
or a raw PID FD. Problem is, as per Linux syscall docs,waitid()
on a PID FD can only be used with a child process fd and not the one made by the jailer.So... I asynchronously
epoll()
with anAsyncFd<RawFd>
in a separate task and send back when the process exited via a oneshot channel, but no way to get an exit code.waitid()
can't be used, onlyepoll()
with readable interest, so I basically have to pretend every time Firecracker exits it does with exit code 0, which is so obviously awful.There was previously an issue that I can't dig up easily rn where the integration tests team decided on printing
exit_code=
something to the end of Firecracker output, which:So what should I do?
Beta Was this translation helpful? Give feedback.
All reactions