Reenable terse mode at shutdown/reboot

Now that we change runlevel at shutdown/reboot, we also need to restore
terse mode before calling the shutdown hooks, like before.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2016-10-24 00:02:18 +02:00
1 parent 0f61b0792b
commit c3b7530b98
2 files changed
+10 -10

No files matched your search

+10
View File
@@ -24,6 +24,7 @@
#include "config.h" /* Generated by configure script */
#include <sched.h>
#include <string.h>
#include <sys/wait.h>
#include <net/if.h>
@@ -487,6 +488,15 @@ void service_reload_dynamic(void)
void service_runlevel(int newlevel)
{
if (newlevel == 0 || newlevel == 6) {
/* If we enabled terse mode at boot, restore to previous setting at shutdown */
if (quiet) {
silent = SILENT_MODE;
if (!silent) {
sched_yield();
fputs("\n", stderr);
}
}
/* Call all shutdown hooks before rebooting... */
plugin_run_hooks(HOOK_SHUTDOWN);
}
-10
View File
@@ -65,7 +65,6 @@
*/
#include <dirent.h>
#include <sched.h>
#include <string.h> /* strerror() */
#include <sys/reboot.h>
#include <sys/wait.h>
@@ -147,15 +146,6 @@ void do_shutdown(shutop_t op)
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) {
silent = SILENT_MODE;
if (!silent) {
sched_yield();
fputs("\n", stderr);
}
}
/* Update UTMP db */
utmp_set_halt();