From 5804e1b6ff2d871500f9bc205e6fa28d4e984961 Mon Sep 17 00:00:00 2001 From: Alan Jenkins Date: Sat, 13 Jan 2018 12:30:43 +0000 Subject: [PATCH] core: fix output (logging) for mount units (#7603) Documentation - systemd.exec - strongly implies mount units get logging. It is safe for mounts to depend on systemd-journald.socket. There is no cyclic dependency generated. This is because the root, -.mount, was already deliberately set to EXEC_OUTPUT_NULL. See comment in mount_load_root_mount(). And /run is excluded from being a mount unit. Nor does systemd-journald depend on /var. It starts earlier, initially logging to /run. Tested before/after using `systemctl stop tmp.mount`. --- src/core/mount.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/mount.c b/src/core/mount.c index 9367869f781..9b0b29bff9e 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -164,6 +164,10 @@ static void mount_init(Unit *u) { assert(u->load_state == UNIT_STUB); m->timeout_usec = u->manager->default_timeout_start_usec; + + m->exec_context.std_output = u->manager->default_std_output; + m->exec_context.std_error = u->manager->default_std_error; + m->directory_mode = 0755; /* We need to make sure that /usr/bin/mount is always called -- 2.47.3