From 59d96f264dd3c1cb9dca9e049ed4687e345db9f3 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Mon, 30 Nov 2015 22:31:47 +0100 Subject: [PATCH] Reenable verbose mode at reboot, if disabled at boot This patch reenables verbose mode at shutdown/reboot, if it was disabled at boot. This allows the user to see the output from the `urandom.so` and `hwclock.so` plugins at reboot. Signed-off-by: Joachim Nilsson --- sig.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sig.c b/sig.c index 977ff36d..fd19e1d2 100644 --- a/sig.c +++ b/sig.c @@ -38,12 +38,14 @@ * It activates the kbrequest action. */ +#include #include /* strerror() */ #include #include #include "finit.h" #include "conf.h" +#include "config.h" #include "helpers.h" #include "plugin.h" #include "private.h" @@ -64,6 +66,15 @@ void do_shutdown(int sig) if (sdown) run_interactive(sdown, "Calling shutdown hook: %s", sdown); + /* If we enabled terse mode at boot, restore to previous setting at shutdown */ + if (quiet) { + verbose = VERBOSE_MODE; + if (verbose) { + sched_yield(); + fputs("\n", stderr); + } + } + /* Call all shutdown hooks before rebooting... */ plugin_run_hooks(HOOK_SHUTDOWN);