From 87ec20ef2089712e6c9a9f3ddfba6c5e312694fe Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 2 May 2016 14:50:27 +0200 Subject: core: fix detection whether per-unit drop-ins changed This fixes fall-out from 6d10d308c6cd16528ef58fa4f5822aef936862d3. Until that commit, do determine whether a daemon reload was required we compare the mtime of the main unit file we loaded with the mtime of it on disk for equality, but for drop-ins we only stored the newest mtime of all of them and then did a "newer-than" comparison. This was brokeni with the above commit, when all checks where changed to be for equality. With this change all checks are now done as "newer-than", fixing the drop-in mtime case. Strictly speaking this will not detect a number of changes that the code before above commit detected, but given that the mtime is unlikely to go backwards, and this is just intended to be a helpful hint anyway, this looks OK in order to keep things simple. Fixes: #3123 --- src/systemctl/systemctl.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/systemctl') diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 9af25e22a4..bec4f31b39 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -2334,6 +2334,8 @@ static int need_daemon_reload(sd_bus *bus, const char *unit) { } static void warn_unit_file_changed(const char *name) { + assert(name); + log_warning("%sWarning:%s %s changed on disk. Run 'systemctl%s daemon-reload' to reload units.", ansi_highlight_red(), ansi_normal(), -- cgit v1.2.3-54-g00ecf