run(): add support for logging/redirect

This patch adds support for optional logging of output from all run()
commands.  For run_interactive() we've opted to log instead of just
redirect, meaning output on error is till on console but also in log.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2022-03-01 20:46:01 +01:00
1 parent ef9e9ec786
commit 6fa3aa41df
7 files changed
+97 -57

No files matched your search

+4 -4
View File
@@ -313,16 +313,16 @@ void do_shutdown(shutop_t op)
/* Unmount any tmpfs before unmounting swap ... */
unmount_tmpfs();
run("swapoff -e -a");
run("swapoff -e -a", "swapoff");
/* ... unmount remaining regular file systems. */
unmount_regular();
/* We sit on / so we must remount it ro, try all the things! */
sync();
run("mount -n -o remount,ro -t dummytype dummydev /");
run("mount -n -o remount,ro dummydev /");
run("mount -n -o remount,ro /");
run("mount -n -o remount,ro -t dummytype dummydev /", "mount");
run("mount -n -o remount,ro dummydev /", "mount");
run("mount -n -o remount,ro /", "mount");
/* Call mdadm to mark any RAID array(s) as clean before halting. */
mdadm_wait();