mirror of
https://github.com/troglobit/finit.git
synced 2026-11-18 19:30:56 +00:00
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:
1 parent
0f61b0792b
commit
c3b7530b98
2 files changed
+10
-10
No files matched your search
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include "config.h" /* Generated by configure script */
|
#include "config.h" /* Generated by configure script */
|
||||||
|
|
||||||
|
#include <sched.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
@@ -487,6 +488,15 @@ void service_reload_dynamic(void)
|
|||||||
void service_runlevel(int newlevel)
|
void service_runlevel(int newlevel)
|
||||||
{
|
{
|
||||||
if (newlevel == 0 || newlevel == 6) {
|
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... */
|
/* Call all shutdown hooks before rebooting... */
|
||||||
plugin_run_hooks(HOOK_SHUTDOWN);
|
plugin_run_hooks(HOOK_SHUTDOWN);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <sched.h>
|
|
||||||
#include <string.h> /* strerror() */
|
#include <string.h> /* strerror() */
|
||||||
#include <sys/reboot.h>
|
#include <sys/reboot.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
@@ -147,15 +146,6 @@ void do_shutdown(shutop_t op)
|
|||||||
if (sdown)
|
if (sdown)
|
||||||
run_interactive(sdown, "Calling shutdown hook: %s", 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 */
|
/* Update UTMP db */
|
||||||
utmp_set_halt();
|
utmp_set_halt();
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user