Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sclang: handle signals (SIGTERM) #6249

Open
sjomae opened this issue Apr 11, 2024 · 0 comments
Open

sclang: handle signals (SIGTERM) #6249

sjomae opened this issue Apr 11, 2024 · 0 comments
Labels
comp: sclang sclang C++ implementation (primitives, etc.). for changes to class lib use "comp: class library" enhancement

Comments

@sjomae
Copy link

sjomae commented Apr 11, 2024

On Linux, when running sclang from the command line, a Ctrl+c stops both sclang and scsynth.

When sending SIGTERM, SIGINT or SIGHUP 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 sending SIGINT?)

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 receiving SIGTERM.

Some languages use the following signal mapping for Windows:
CONTROL_C_EVENT and CTRL_BREAK_EVENT is mapped to SIGINT
CTRL_CLOSE_EVENT, CTRL_LOGOFF_EVENT and CTRL_SHUTDOWN_EVENT is mapped to SIGTERM.
https://pkg.go.dev/os/signal#hdr-Windows

@sjomae sjomae changed the title handle signals (SIGTERM) sclang: handle signals (SIGTERM) Apr 12, 2024
@JordanHendersonMusic JordanHendersonMusic added the comp: sclang sclang C++ implementation (primitives, etc.). for changes to class lib use "comp: class library" label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: sclang sclang C++ implementation (primitives, etc.). for changes to class lib use "comp: class library" enhancement
Projects
None yet
Development

No branches or pull requests

2 participants