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:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user