1 From 04522f492dc25d650c22e2d4a11296e72fa40e32 Mon Sep 17 00:00:00 2001
2 From: Alexander Shishkin <ext-alexander.shishkin@nokia.com>
3 Date: Wed, 17 Jun 2009 16:01:31 +0300
4 Subject: [PATCH] Call telinit for normal reboot/shutdown.
6 Signed-off-by: Alexander Shishkin <ext-alexander.shishkin@nokia.com>
8 init/Config.in | 14 ++++++++++++++
9 init/halt.c | 12 ++++++++++++
10 2 files changed, 26 insertions(+), 0 deletions(-)
12 diff --git a/init/Config.in b/init/Config.in
13 index 25f4390..ea91b45 100644
16 @@ -12,6 +12,20 @@ config INIT
18 init is the first program run when the system boots.
21 + bool "Call telinit on shutdown and reboot"
26 + string "Path to telinit executable"
27 + default "/sbin/telinit"
28 + depends on CALL_TELINIT
30 + When busybox halt and friends have to call external telinit
31 + to facilitate proper shutdown, this path is to be used when
32 + locating telinit executable.
37 diff --git a/init/halt.c b/init/halt.c
38 index c14f0f2..b877be1 100644
41 @@ -84,6 +84,18 @@ RB_AUTOBOOT
44 rc = kill(1, signals[which]);
45 + } else if (ENABLE_CALL_TELINIT && !(flags & 4)) {
49 + const char *telinit_argv[] = {
51 + which == 2 ? "6" : "0",
55 + forkexit_or_rexec();
56 + execve(CONFIG_TELINIT_PATH, telinit_argv, environ);
58 rc = reboot(magic[which]);