mirror of
https://github.com/troglobit/finit.git
synced 2026-10-07 16:14:21 +07:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user