-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Bug] Unable to start or daemonize firecracker vms with jailer #4140
Comments
Hi, for the 1st error, can you remove this bit? |
No change, same error. |
Thinking about this a bit more... that might explain why --daemonize doesn't work? From the man page: setsid() fails with EPERM if "[t]he process group ID of any process equals the PID of the calling process. Thus, in particular, setsid() fails if the calling process is already a process group leader." I'm a little fuzzy on pid namespaces, but if the firecracker child is in a new pid namespace (and thus has no reference to its parent) then presumably its process group id matches its pid, which would cause setsid() to fail with EPERM. If that's the case, perhaps that should treated as a non-fatal error? It still doesn't explain why setting terminal options would fail. |
Hi @fffe, I was able to get jailer working with you steps and below command (removed --new-pid-ns):
Could you please confirm if this works for you? |
Sorry, I should have been clearer that I'd tried that (and it worked) when I flagged --new-pid-ns as the problem in the bug report. I don't plan to daemonize these, I was just trying to dodge the terminal setup issue. I will likely run them in the foreground via systemd. It would be nice if pid namespacing worked there. With that said, I think it's incorrect to classify this as a documentation bug, unless the bug is that --new-pid-ns is never expected to work? Reading the jailer docs again, they actually warned me about this (oops):
... but that just seems like a bug in itself. Since setsid() will always fail in that case, and --daemonize does more than just call setsid(), it seems like the better way to handle that is to just not call (or provide an option to not call) setsid() when launched in a pid namespace? It still makes no sense to me why this appears to be causing the terminal issue as well. |
Hi @fffe , Sorry for the delay in getting back on this issue and also for missing the jailer documentation earlier. |
Hi @fffe , Just to let you know, we believe that we have fixed the issue and there is no pending action on our side. Please let us know if you still observe the failure, otherwise we're planning to close the issue in a couple of weeks. |
Hi @fffe , Thanks! |
Describe the bug
I have been following along with the getting started guide, but I am unable to start firecracker vms using jailer.
When I try to start a vm via jailer in the foreground, I get this error:
If I try to daemonize jailer, I get this error instead:
The same config file boots as expected when firecracker is run directly.
To Reproduce
I followed these commands to get started:
My config.json looks like this:
I then did a bit of basic setup in the chroot environment -- copying in the config file + kernel + rootfs -- and tried to launch the vm via jailer:
I haven't found anything about this on Google or in the issue tracker, and I have no idea why it might fail.
I tried to daemonize it in the hopes that it wouldn't bother with the terminal at all, but that gave me a different error:
setsid() can fail if the process is already a leader, but otherwise I have no idea why this isn't working. As before, no hits on Google or in the issue tracker that I saw.
If I run the same config file directly via firecracker, it boots successfully:
It will complain because the tap device isn't setup properly (it doesn't know about the netns), but the vm boots and the cli is usable.
Expected behaviour
I expect firecracker vms started via jailer to boot.
Environment
Firecracker v1.4.1
Host: 5.15.0-84.93 Ubuntu kernel (current for Ubuntu 22.04)
Guest: vmlinux-5.10.186 (current image provided by getting started guide)
ubuntu-22.04.ext4 (current image provided by getting started guide)
x86-64
Additional context
It appears to be caused by the
--new-pid-ns
option.Checks
The text was updated successfully, but these errors were encountered: