init: don't block for resource upgrades

If some sessions run out of memory in init, resource requests will be issued
to core, which it never will satisfy. Setting some default signal handler
avoids that the default implementation will block init for ever.

Issue #1632
This commit is contained in:
Alexander Boettcher 2015-07-15 10:30:44 +02:00 committed by Norman Feske
parent 28223e3146
commit 73f9bb73cd

View File

@ -294,8 +294,11 @@ int main(int, char **)
* Signal receiver for config changes
*/
Signal_receiver sig_rec;
Signal_context sig_ctx;
config()->sigh(sig_rec.manage(&sig_ctx));
Signal_context sig_ctx_config;
Signal_context sig_ctx_res_avail;
config()->sigh(sig_rec.manage(&sig_ctx_config));
/* prevent init to block for resource upgrades (never satisfied by core) */
env()->parent()->resource_avail_sigh(sig_rec.manage(&sig_ctx_res_avail));
for (;;) {
@ -364,7 +367,13 @@ int main(int, char **)
*/
/* wait for config change */
sig_rec.wait_for_signal();
while (true) {
Signal signal = sig_rec.wait_for_signal();
if (signal.context() == &sig_ctx_config)
break;
PWRN("unexpected signal received - drop it");
}
/* kill all currently running children */
while (children.any()) {