Poll the nic on the sampler's cadence, and reboot rather than exit when a clean return reaches PID 1

This commit is contained in:
flamingcow
2026-08-05 08:18:44 -07:00
parent ab60cc1cfc
commit 88f4f7da80
2 changed files with 12 additions and 4 deletions
+8
View File
@@ -535,6 +535,14 @@ func main() {
if err := run(*aName, *bName, *nsPerM); err != nil {
panic(err)
}
// A clean return is ctrl-alt-delete, which the kernel hands PID 1 as a
// SIGINT. Exiting on it would panic the kernel over the reboot it was asking
// for, so init asks for the reboot by name.
if os.Getpid() == 1 {
if err := unix.Reboot(unix.LINUX_REBOOT_CMD_RESTART); err != nil {
panic(err)
}
}
}
const (