am 121400a4: Merge "Make init distinguish between orderly exit and being killed by signals."

* commit '121400a40fce22b6e0b74f2492b8b9eff6133bd1':
  Make init distinguish between orderly exit and being killed by signals.
diff --git a/init/signal_handler.c b/init/signal_handler.c
index d31ad63..7e8e1a7 100644
--- a/init/signal_handler.c
+++ b/init/signal_handler.c
@@ -57,7 +57,15 @@
 
     svc = service_find_by_pid(pid);
     if (!svc) {
-        ERROR("untracked pid %d exited\n", pid);
+        if (WIFEXITED(status)) {
+            ERROR("untracked pid %d exited with status %d\n", pid, WEXITSTATUS(status));
+        } else if (WIFSIGNALED(status)) {
+            ERROR("untracked pid %d killed by signal %d\n", pid, WTERMSIG(status));
+        } else if (WIFSTOPPED(status)) {
+            ERROR("untracked pid %d stopped by signal %d\n", pid, WSTOPSIG(status));
+        } else {
+            ERROR("untracked pid %d state changed\n", pid);
+        }
         return 0;
     }