Ruby: prevented a segfault on receiving SIGINT (^C).
As was reported[0] by @travisbell on GitHub, if running unit from the terminal in the foreground when hitting ^C to exit it, the ruby application processes would segfault if they were using threads. It's not 100% clear where the actual problem lies, but it _looks_ like it may be in ruby. The simplest way to deal with this for now is to just ignore SIGINT in the ruby application processes. Unit will still receive and handle it, cleanly shutting everything down. For people who want to handle SIGINT in their ruby application running under unit they can still trap SIGINT and it will override the ignore. [0]: https://github.com/nginx/unit/issues/562#issuecomment-1223229585 Closes: https://github.com/nginx/unit/issues/562
This commit is contained in:
@@ -270,6 +270,8 @@ nxt_ruby_start(nxt_task_t *task, nxt_process_data_t *data)
|
||||
|
||||
static char *argv[2] = { (char *) "NGINX_Unit", (char *) "-e0" };
|
||||
|
||||
signal(SIGINT, SIG_IGN);
|
||||
|
||||
conf = data->app;
|
||||
c = &conf->u.ruby;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user