about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nitro.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/nitro.c b/nitro.c
index c973c46..c1f8c79 100644
--- a/nitro.c
+++ b/nitro.c
@@ -438,6 +438,13 @@ proc_finish(int i)
 
 		setsid();
 
+		if (strcmp(services[i].name, "SYS") == 0) {
+			if (global_state == GLBL_WANT_REBOOT)
+				instance = (char *)"reboot";
+			else if (global_state == GLBL_WANT_SHUTDOWN)
+				instance = (char *)"shutdown";
+		}
+
 		if (instance)
 			execle("finish", "finish", run_status, run_signal, instance, (char *)0, child_environ);
 		else