Page MenuHomeFreeBSD

bhyve: monitor: forward SIGTERM to the VM process
ClosedPublic

Authored by novel on Aug 11 2026, 4:56 PM.
Tags
None
Referenced Files
F171775131: D58788.diff
Sun, Sep 13, 10:50 AM
Unknown Object (File)
Fri, Sep 11, 6:14 PM
Unknown Object (File)
Wed, Sep 9, 10:09 AM
Unknown Object (File)
Sat, Sep 5, 12:18 PM
Unknown Object (File)
Fri, Sep 4, 7:21 AM
Unknown Object (File)
Thu, Sep 3, 8:11 PM
Unknown Object (File)
Thu, Sep 3, 11:57 AM
Unknown Object (File)
Thu, Sep 3, 8:08 AM

Details

Summary

Currently, sending SIGTERM to the bhyve process triggers ACPI poweroff
for a VM. However, when running bhyve in monitor mode (-M), there are
two processes: the monitor process and the actual VM process. Sending
SIGTERM to the VM process works as before -- it powers off the VM.
But sending SIGTERM to the monitor process just kills the monitor process,
leaving the stale VM process running.

Thus, forward the SIGTERM signal from the monitor process to the
VM process for consistency.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

novel requested review of this revision.Aug 11 2026, 4:56 PM
markj added a subscriber: markj.

Thanks, I've run into this problem too.

Rather than forwarding signals, why not have a pipe shared between the two processes? The child process can use it to detect when the parent goes away, and exit automatically. That should be simpler and will work for all cases where the parent exits (assertion failure, SIGKILL, etc.).

Thanks, I've run into this problem too.

Rather than forwarding signals, why not have a pipe shared between the two processes? The child process can use it to detect when the parent goes away, and exit automatically. That should be simpler and will work for all cases where the parent exits (assertion failure, SIGKILL, etc.).

+1 for this approach, it's more robust than forwarding signals. I was planning to implement this pipe-based fix soon, but if you have the time and will to do so please go for it!

Thanks, I've run into this problem too.

Rather than forwarding signals, why not have a pipe shared between the two processes? The child process can use it to detect when the parent goes away, and exit automatically. That should be simpler and will work for all cases where the parent exits (assertion failure, SIGKILL, etc.).

+1 for this approach, it's more robust than forwarding signals. I was planning to implement this pipe-based fix soon, but if you have the time and will to do so please go for it!

Pipe is a good idea, I didn't think about that. Will try to implement it, thanks.

Re-implement monitoring using a pipe.

Looks good, thanks. The review title and description are stale now, I presume you will fix them before pushing.

This revision is now accepted and ready to land.Aug 13 2026, 2:54 PM
This revision was automatically updated to reflect the committed changes.