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 <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2015-11-30 22:31:48 +01:00
parent 7027cbc439
commit 59d96f264d
+11
View File
@@ -38,12 +38,14 @@
* It activates the kbrequest action.
*/
#include <sched.h>
#include <string.h> /* strerror() */
#include <sys/reboot.h>
#include <sys/wait.h>
#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);