basic/namespace-util: fix double logging after fork failure

[   10.056930] (journald)[104]: Failed to fork off '(sd-mkuserns)': Invalid argument
[   10.063727] systemd[1]: systemd-modules-load.service: About to execute: /usr/lib/systemd/systemd-modules-load
[   10.071148] (journald)[104]: Failed to fork process (sd-mkuserns): Invalid argument

safe_fork_full() already logs at debug level, so the caller shouldn't.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2024-12-02 11:51:23 +01:00
parent afb368951c
commit 22996a3393
+1 -1
View File
@@ -348,7 +348,7 @@ int userns_acquire(const char *uid_map, const char *gid_map) {
r = safe_fork("(sd-mkuserns)", FORK_CLOSE_ALL_FDS|FORK_DEATHSIG_SIGKILL|FORK_NEW_USERNS, &pid);
if (r < 0)
return log_debug_errno(r, "Failed to fork process (sd-mkuserns): %m");
return r;
if (r == 0)
/* Child. We do nothing here, just freeze until somebody kills us. */
freeze();