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
diff --git a/init/init.cpp b/init/init.cpp
index b1d65db..4d5b2ee 100644
--- a/init/init.cpp
+++ b/init/init.cpp
@@ -1034,6 +1034,9 @@
 
     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 @@
     // 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];