From 4f673306fc20736be4f4fab602718f9dd28ff5e9 Mon Sep 17 00:00:00 2001 From: Johan Redestig Date: Sat, 18 Apr 2015 14:13:24 +0200 Subject: [PATCH] Setup signal handler before any exec command Fixes init deadlock when an exec command was called in an on-init section. The exec command handling relies on that the signal handler mechanism is working to know when to continue executing commands. Change-Id: Ib0ce75ffad7cf3bf926c93d0506b2fe3e5a92630 --- init/init.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init/init.cpp b/init/init.cpp index b1d65dbc0..4d5b2ee3c 100644 --- a/init/init.cpp +++ b/init/init.cpp @@ -1034,6 +1034,9 @@ int main(int argc, char** argv) { init_parse_config_file("/init.rc"); + // Setup signal handler before any exec command or we'll deadlock + queue_builtin_action(signal_init_action, "signal_init"); + action_for_each_trigger("early-init", action_add_queue_tail); queue_builtin_action(wait_for_coldboot_done_action, "wait_for_coldboot_done"); @@ -1048,7 +1051,6 @@ int main(int argc, char** argv) { // wasn't ready immediately after wait_for_coldboot_done queue_builtin_action(mix_hwrng_into_linux_rng_action, "mix_hwrng_into_linux_rng"); queue_builtin_action(property_service_init_action, "property_service_init"); - queue_builtin_action(signal_init_action, "signal_init"); // Don't mount filesystems or start core system services in charger mode. char bootmode[PROP_VALUE_MAX];