aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2017-04-17 12:23:45 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2017-04-17 12:23:45 -0500
commit0e3f8720984d7d5752a78a4135cd268e4f83b3d7 (patch)
tree0d569b35dc002b43fd8ca72db65e0ef9e88fe1ca
parentreword the bugs section of the openrc-init man page (diff)
downloadopenrc-0e3f8720984d7d5752a78a4135cd268e4f83b3d7.zip
openrc-0e3f8720984d7d5752a78a4135cd268e4f83b3d7.tar.gz
openrc-0e3f8720984d7d5752a78a4135cd268e4f83b3d7.tar.bz2
init: send term/kill signals as final step of shutdown
-rw-r--r--src/rc/openrc-init.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rc/openrc-init.c b/src/rc/openrc-init.c
index 621c81e..8abe0dd 100644
--- a/src/rc/openrc-init.c
+++ b/src/rc/openrc-init.c
@@ -96,6 +96,11 @@ static void handle_shutdown(const char *runlevel, int cmd)
pid = do_openrc(runlevel);
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();
reboot(cmd);
}