mirror of
https://github.com/troglobit/finit.git
synced 2026-11-10 16:31:21 +00:00
Add more progress messages at shutdown/reboot
This patch changes the way progress for unmounting filesystems is displayed. To see each filesystem being unmounted Finit now must be in debug mode. A general "Unmounting filesystems ..." have been added instead as well as progress for last hook script and finall call to reboot(). Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
cfa871c548
commit
1d92819d92
2 files changed
+7
-3
No files matched your search
+2
-1
@@ -97,13 +97,14 @@ static int unmount(const char *target)
|
|||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
dbg("Unmounting %s", target);
|
||||||
|
|
||||||
rc = umount(target);
|
rc = umount(target);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
if (errno != EBUSY)
|
if (errno != EBUSY)
|
||||||
print(2, "Failed unmounting %s, error %d: %s", target, errno, strerror(errno));
|
print(2, "Failed unmounting %s, error %d: %s", target, errno, strerror(errno));
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
print(0, "Unmounting %s", target);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -357,6 +357,7 @@ void do_shutdown(shutop_t op)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Unmount any tmpfs before unmounting swap ... */
|
/* Unmount any tmpfs before unmounting swap ... */
|
||||||
|
print(0, "Unmounting filesystems ...");
|
||||||
unmount_tmpfs();
|
unmount_tmpfs();
|
||||||
fs_swapoff();
|
fs_swapoff();
|
||||||
|
|
||||||
@@ -378,10 +379,12 @@ void do_shutdown(shutop_t op)
|
|||||||
mdadm_wait();
|
mdadm_wait();
|
||||||
|
|
||||||
/* Last chance to run scripts (all .so plugins have exited already) */
|
/* Last chance to run scripts (all .so plugins have exited already) */
|
||||||
|
print(0, "Calling hook/svc/down scripts ...");
|
||||||
plugin_run_hooks(HOOK_SYS_DN);
|
plugin_run_hooks(HOOK_SYS_DN);
|
||||||
|
|
||||||
/* Reboot via watchdog or kernel, or shutdown? */
|
/* Reboot via watchdog or kernel, or shutdown? */
|
||||||
if (op == SHUT_REBOOT) {
|
if (op == SHUT_REBOOT) {
|
||||||
|
print(0, "Rebooting ...");
|
||||||
if (wdog && wdog->pid > 1) {
|
if (wdog && wdog->pid > 1) {
|
||||||
int timeout = 10;
|
int timeout = 10;
|
||||||
|
|
||||||
@@ -394,12 +397,12 @@ void do_shutdown(shutop_t op)
|
|||||||
dbg("Rebooting ...");
|
dbg("Rebooting ...");
|
||||||
reboot(RB_AUTOBOOT);
|
reboot(RB_AUTOBOOT);
|
||||||
} else if (op == SHUT_OFF) {
|
} else if (op == SHUT_OFF) {
|
||||||
dbg("Powering down ...");
|
print(0, "Powering down ...");
|
||||||
reboot(RB_POWER_OFF);
|
reboot(RB_POWER_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Also fallback if any of the other two fails */
|
/* Also fallback if any of the other two fails */
|
||||||
dbg("Halting ...");
|
print(0, "Halting ...");
|
||||||
reboot(RB_HALT_SYSTEM);
|
reboot(RB_HALT_SYSTEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user