Then:
This can take a few seconds to complete.
hmmm, one ought to be careful doing that.
these node-in-a-box systems could have a bitcoin service that's configured to recognize when bitcoind dies and restart it ASAP. the user might see the bitcoind process successfully go down, confidently sends
poweroff, and meanwhile bitcoind is restarting (or even fully started) before the machine completes
poweroff.
bitcoin is more resilient to being unexpectedly killed than it used to be, but there are still no guarantees against corrupted data (which means resyncing the whole chain in the worst case). although I'm not sure what linux does to kill processes on
poweroff, if it's standard
kill [pid] (as you've written above) then it would actually do the right thing and wait for bitcoind to finish correctly before
poweroff completes (
kill sends SIGTERM by default, which is at least one of the signals bitcoind catches to do an orderly shutdown)
so check what the OS actually does, and preferably use the in-house command for shutting bitcoind down before
poweroffand yes, definitely never just turn the computer off at the wall, you're asking for problems that way