A user brought up to us here that fly machine restart
was ignoring the signal
parameter. This is the signal used to kill the app before the machine gets restarted.
While doing a refactor around 2 years ago, we accidentally stopped passing along the signal parameter from the machines API to flyd, and just defaulted to SIGINT in all cases. So, this fix was simply to add it back and resume passing it through.
You probably don’t need to change the default signal in most cases, and we’ll use your configured kill_signal
option if specified, but it might be handy sometimes to force kill a machine with SIGTERM.
❯ fly machine restart --signal SIGTERM 080e337f511e68
Restarting machine 080e337f511e68
No health checks found
Machine 080e337f511e68 restarted successfully!
❯ fly logs
2024-05-03T22:17:47Z app[080e337f511e68] iad [info] INFO Sending signal SIGTERM to main child process w/ PID 313
2024-05-03T22:17:47Z app[080e337f511e68] iad [info]2024/05/03 22:17:47 [notice] 313#313: signal 15 (SIGTERM) received from 1, exiting
2024-05-03T22:17:47Z app[080e337f511e68] iad [info]2024/05/03 22:17:47 [notice] 340#340: exiting
2024-05-03T22:17:47Z app[080e337f511e68] iad [info]2024/05/03 22:17:47 [notice] 340#340: exit
2024-05-03T22:17:47Z app[080e337f511e68] iad [info]2024/05/03 22:17:47 [notice] 313#313: signal 17 (SIGCHLD) received from 340
2024-05-03T22:17:47Z app[080e337f511e68] iad [info]2024/05/03 22:17:47 [notice] 313#313: worker process 340 exited with code 0
2024-05-03T22:17:47Z app[080e337f511e68] iad [info]2024/05/03 22:17:47 [notice] 313#313: exit
2024-05-03T22:17:47Z app[080e337f511e68] iad [info] INFO Main child exited normally with code: 0