From 8f63253149356e3aaa3545271e6f3654f7a6e5e7 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 19 Apr 2018 10:34:58 +0200 Subject: [PATCH] core: don't export per-unit metadata files in test mode We shouldn't clobber the host's /run directories with metadata we export for our units when we run in test mode. --- src/core/unit.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/unit.c b/src/core/unit.c index 01e7cc9683..6affc65fe9 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -5169,6 +5169,9 @@ void unit_export_state_files(Unit *u) { if (!MANAGER_IS_SYSTEM(u->manager)) return; + if (u->manager->test_run_flags != 0) + return; + /* Exports a couple of unit properties to /run/systemd/units/, so that journald can quickly query this data * from there. Ideally, journald would use IPC to query this, like everybody else, but that's hard, as long as * the IPC system itself and PID 1 also log to the journal. -- 2.25.1