systemctl: don't warn unit needs reload if --no-warn

This commit is contained in:
Mike Yuan 2024-02-14 21:19:21 +08:00
parent a0437868d8
commit 3725766266
2 changed files with 7 additions and 1 deletions

View file

@ -2289,7 +2289,10 @@ Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output err
</listitem>
<listitem>
<para>when a <command>stop</command>-ped, <command>disable</command>-d, or <command>mask</command>-ed
unit still has active triggering units.</para>
unit still has active triggering units,</para>
</listitem>
<listitem>
<para>when a unit file is changed and requires <command>daemon-reload</command>.</para>
</listitem>
</itemizedlist>
</para>

View file

@ -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");