sclang: handle signals (SIGTERM) #6249
Labels
comp: sclang
sclang C++ implementation (primitives, etc.). for changes to class lib use "comp: class library"
enhancement
On Linux, when running sclang from the command line, a
Ctrl+c
stops both sclang and scsynth.When sending
SIGTERM
,SIGINT
orSIGHUP
to sclang only sclang is terminated and scsynth is still running, which is probably the right thing to do.(Why does it act different on
Ctrl+c
, isn't that sendingSIGINT
?)Would it be possible to let the user of sclang define a function / method which handles signals? So a custom signal handler for if sclang receives
SIGTERM
for instance. Then the user can decide to send\quit
to scsynth, for instance, when receivingSIGTERM
.Some languages use the following signal mapping for Windows:
CONTROL_C_EVENT
andCTRL_BREAK_EVENT
is mapped toSIGINT
CTRL_CLOSE_EVENT
,CTRL_LOGOFF_EVENT
andCTRL_SHUTDOWN_EVENT
is mapped toSIGTERM
.https://pkg.go.dev/os/signal#hdr-Windows
The text was updated successfully, but these errors were encountered: