summaryrefslogtreecommitdiffhomepage
path: root/init/init.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-09-16 06:49:06 +0000
committerEric Andersen <andersen@codepoet.org>2002-09-16 06:49:06 +0000
commita9cc8961eda213ae40a7faa9427ca5be166a3154 (patch)
tree245f7eed230deb980b41fa0e7e04d0465969c6ec /init/init.c
parente18cb71e0c680a165243b26b872e0ccdfd9a37f1 (diff)
Let people run SHUTDOWN actions prior to killing everything
-Erik
Diffstat (limited to 'init/init.c')
-rw-r--r--init/init.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/init/init.c b/init/init.c
index 013f55c68..ab2d0ea91 100644
--- a/init/init.c
+++ b/init/init.c
@@ -715,6 +715,11 @@ static void shutdown_system(void)
{
sigset_t block_signals;
+ /* run everything to be run at "shutdown". This is done _prior_
+ * to killing everything, in case people wish to use scripts to
+ * shut things down gracefully... */
+ run_actions(SHUTDOWN);
+
/* first disable all our signals */
sigemptyset(&block_signals);
sigaddset(&block_signals, SIGHUP);
@@ -744,9 +749,6 @@ static void shutdown_system(void)
kill(-1, SIGKILL);
sleep(1);
- /* run everything to be run at "shutdown" */
- run_actions(SHUTDOWN);
-
sync();
if (kernelVersion > 0 && kernelVersion <= KERNEL_VERSION(2, 2, 11)) {
/* bdflush, kupdate not needed for kernels >2.2.11 */