init: send term/kill signals as final step of shutdown

This commit is contained in:
William Hubbs 2017-04-17 12:23:45 -05:00
parent 5fd3747b19
commit 0e3f872098

View File

@ -96,6 +96,11 @@ static void handle_shutdown(const char *runlevel, int cmd)
pid = do_openrc(runlevel); pid = do_openrc(runlevel);
while (waitpid(pid, NULL, 0) != pid); while (waitpid(pid, NULL, 0) != pid);
printf("Sending the final term signal\n");
kill(-1, SIGTERM);
sleep(3);
printf("Sending the final kill signal\n");
kill(-1, SIGKILL);
sync(); sync();
reboot(cmd); reboot(cmd);
} }