aurae icon indicating copy to clipboard operation
aurae copied to clipboard

POSIX Signal Handler and Proxy/Bus

Open krisnova opened this issue 3 years ago • 3 comments

Now that auraed is launching nested versions of itself, we will need to proxy POSIX signals through auraed

  1. 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

  1. Use SIGINT instead of SIGKILL to "free" a nested auraed after the signal handler has been implemented.

  2. 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!

krisnova avatar Dec 27 '22 19:12 krisnova

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.

dmah42 avatar Dec 30 '22 15:12 dmah42

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?

future-highway avatar Jan 02 '23 15:01 future-highway

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?

dmah42 avatar Jun 21 '24 15:06 dmah42