From 3725766266f18f40799c726cd44311cc1040c74f Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Wed, 14 Feb 2024 21:19:21 +0800 Subject: [PATCH] systemctl: don't warn unit needs reload if --no-warn --- man/systemctl.xml | 5 ++++- src/systemctl/systemctl-util.c | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/man/systemctl.xml b/man/systemctl.xml index 4a84df343b7..98844783b01 100644 --- a/man/systemctl.xml +++ b/man/systemctl.xml @@ -2289,7 +2289,10 @@ Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output err when a stop-ped, disable-d, or mask-ed - unit still has active triggering units. + unit still has active triggering units, + + + when a unit file is changed and requires daemon-reload. diff --git a/src/systemctl/systemctl-util.c b/src/systemctl/systemctl-util.c index f37401d917c..de6f53aafe6 100644 --- a/src/systemctl/systemctl-util.c +++ b/src/systemctl/systemctl-util.c @@ -434,6 +434,9 @@ int need_daemon_reload(sd_bus *bus, const char *unit) { void warn_unit_file_changed(const char *unit) { assert(unit); + if (arg_no_warn) + return; + log_warning("Warning: The unit file, source configuration file or drop-ins of %s changed on disk. Run 'systemctl%s daemon-reload' to reload units.", unit, arg_runtime_scope == RUNTIME_SCOPE_SYSTEM ? "" : " --user");