From 19a44dfe4525ab01caf593a9c2beada4b412910d Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Wed, 18 Oct 2017 08:38:50 +0200 Subject: [PATCH] core: fragments of masked units ought not be considered for NeedDaemonReload (#7060) The units that are not loaded don't have dropin_paths set. This currently results in units that have fragments to always have NeedDaemonReload=true when masked: $ find {/usr/lib,/run/user/8086}/systemd/user/meh.service* |xargs ls -ld lrwxrwxrwx. 1 lkundrak lkundrak 9 Oct 11 11:19 /run/user/8086/systemd/user/meh.service -> /dev/null -rw-rw-r--. 1 root root 49 Oct 11 10:16 /usr/lib/systemd/user/meh.service drwxrwxr-x. 2 root root 4096 Oct 11 10:50 /usr/lib/systemd/user/meh.service.d -rw-rw-r--. 1 root root 666 Oct 11 10:50 /usr/lib/systemd/user/meh.service.d/override.conf $ systemctl --user daemon-reload $ busctl --user get-property org.freedesktop.systemd1 \ /org/freedesktop/systemd1/unit/meh_2eservice \ org.freedesktop.systemd1.Unit NeedDaemonReload b true --- src/core/unit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/unit.c b/src/core/unit.c index 357306d..f6b281b 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -3485,7 +3485,8 @@ bool unit_need_daemon_reload(Unit *u) { if (fragment_mtime_newer(u->source_path, u->source_mtime, false)) return true; - (void) unit_find_dropin_paths(u, &t); + if (u->load_state == UNIT_LOADED) + (void) unit_find_dropin_paths(u, &t); if (!strv_equal(u->dropin_paths, t)) return true; -- 2.7.4