1 |
commit: 0e3f8720984d7d5752a78a4135cd268e4f83b3d7 |
2 |
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com> |
3 |
AuthorDate: Mon Apr 17 17:23:45 2017 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Apr 17 17:23:45 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=0e3f8720 |
7 |
|
8 |
init: send term/kill signals as final step of shutdown |
9 |
|
10 |
src/rc/openrc-init.c | 5 +++++ |
11 |
1 file changed, 5 insertions(+) |
12 |
|
13 |
diff --git a/src/rc/openrc-init.c b/src/rc/openrc-init.c |
14 |
index 621c81ea..8abe0dd6 100644 |
15 |
--- a/src/rc/openrc-init.c |
16 |
+++ b/src/rc/openrc-init.c |
17 |
@@ -96,6 +96,11 @@ static void handle_shutdown(const char *runlevel, int cmd) |
18 |
|
19 |
pid = do_openrc(runlevel); |
20 |
while (waitpid(pid, NULL, 0) != pid); |
21 |
+ printf("Sending the final term signal\n"); |
22 |
+ kill(-1, SIGTERM); |
23 |
+ sleep(3); |
24 |
+ printf("Sending the final kill signal\n"); |
25 |
+ kill(-1, SIGKILL); |
26 |
sync(); |
27 |
reboot(cmd); |
28 |
} |