[systemd-devel] [PATCH] nspawn: do not check audit if --boot argument is not set

Djalal Harouni tixxdz at opendz.org
Sat Feb 15 15:03:21 PST 2014


Currently systemd-nspawn will call reset_audit_loginuid() and check
if audit is enabled in the kernel even if it was invoked without the
--boot argument. This makes systemd-nspawn print the audit error message
and sleep(5) on every execution.

This was introduced by commit db999e0f923ca6. Fix it by checking if
arg_boot is set before before calling reset_audit_loginuid().
---
 src/nspawn/nspawn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index a81bb8e..1d1662d 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -1726,7 +1726,7 @@ int main(int argc, char *argv[]) {
                                 goto child_fail;
                         }
 
-                        if (reset_audit_loginuid() < 0)
+                        if (arg_boot && reset_audit_loginuid() < 0)
                                 goto child_fail;
 
                         if (prctl(PR_SET_PDEATHSIG, SIGKILL) < 0) {
-- 
1.8.5.3



More information about the systemd-devel mailing list