Fix stuck process on TrueNAS shutdown
I've seen on several systems (Z20-HA, X10-HA, and various customer boxes) that when you try to do a shutdown (passive node on HA, or only node on non-HA since active node HA will sysctl panic) that it gets stuck on a given process. It takes a few minutes, but eventually returns with a timeout and shuts down.
This seems to have begun on 11.1-U4 and was not present on 11.0-U6. Noteworthy is that I did see this on other 11.1-U(x) builds of TrueNAS that were internal, and apparently nobody filed a bug or fixed it.
In case it is useful info,
The documented ways of stopping Consul are SIGINT and SIGKILL:
This is due to change soon to SIGINT and SIGTERM:
This ticket can be closed because consul-alerts was removed in commit: https://github.com/freenas/build/commit/914d29437f0d34364ba3abd9c9e0aa08903682b1
Yes, in narrow sense this problem was fixed. But in wider sense there is still uncertainty how active controller reboot is handled, what if some services shut down while other(s) get stuck up, and what client will see as result instead of clean failover. We should explicitly trigger failover on reboot/shutdown request, which I guess may not be the case now, need to check it.