POSIX Signal Handler and Proxy/Bus
Now that auraed is launching nested versions of itself, we will need to proxy POSIX signals through auraed
- Implement a POSIX compliant signal handler in Rust in Auraed and provide documentation on which signals map to what behavior.
SIGKILL should terminate (kill) the process
SIGHUP should reload the config from disk and reopen logfiles
SIGINT should "interrupt" the process and begin to "die nice" ensuring any cleanup logic can be done
-
Use
SIGINTinstead ofSIGKILLto "free" a nested auraed after the signal handler has been implemented. -
Proxy all signals to nested executables for them to manage independently.
For example sending a SIGHUP to a nested auraed should proxy a SIGHUP to all of the nested executables!
i believe SIGTERM should do the "die nice". SIGINT is a "user triggered interrupt" signal that processes can interpret however they want but it doesn't necessarily suggest termination.
https://dsa.cs.tsinghua.edu.cn/oj/static/unix_signal.html
this also suggests "SIGINT is nearly identical to SIGTERM". SIGINT is explicity "sent from a user" though.
Looking for some clarification on 3...
Should (a) every signal auraed receives be sent to every executable? Or are we saying (b) we want to add rpc signal(CellServiceSignalRequest) ... so that clients can send targeted signals to select executables?
I'm thinking we want the option b. Right?
if a SIGKILL is sent to auraed, i assume it means "die in a fire" and we should take down everything auraed has spawned along with us.
SIGTERM would be the same, and would also expect spawned processes/nested aurae to "die nicely" so that needs to be passed along, but maybe that means calling the various Stop and Free APIs instead.
SIGHUP is a different one as i suspect we'd only want that to be handled by auraed.
so i think 1 and 2 hold, but 3 isn't necessary as it's not obvious how we would interpret the signals.
this leaves an open question: how do we send a signal to a spawned executable managed by a nested auraed?