mkfs-util: let's debug log about all fork off cmdlines

This commit is contained in:
Lennart Poettering
2026-07-01 16:10:39 +02:00
parent ef7b9f679b
commit b4502c72c8
+7 -3
View File
@@ -4,6 +4,7 @@
#include <sys/mount.h>
#include <unistd.h>
#include "escape.h"
#include "log.h"
#include "mkfs-util.h"
#include "mount-util.h"
@@ -154,6 +155,11 @@ static int mtools_exec(char *const *argv) {
assert(argv);
assert(argv[0]);
if (DEBUG_LOGGING) {
_cleanup_free_ char *j = quote_command_line(argv, SHELL_ESCAPE_EMPTY);
log_debug("Invoking mtools command: %s", strna(j));
}
r = pidref_safe_fork(
"(mtools)",
FORK_RESET_SIGNALS|FORK_RLIMIT_NOFILE_SAFE|FORK_DEATHSIG_SIGTERM|FORK_LOG|FORK_WAIT|FORK_STDOUT_TO_STDERR|FORK_CLOSE_ALL_FDS,
@@ -635,9 +641,7 @@ int make_filesystem(
log_info("Formatting %s as %s", node, fstype);
if (DEBUG_LOGGING) {
_cleanup_free_ char *j = NULL;
j = strv_join(argv, " ");
_cleanup_free_ char *j = quote_command_line(argv, SHELL_ESCAPE_EMPTY);
log_debug("Executing mkfs command: %s", strna(j));
}