network: also log drop-in config files

We have already show used drop-in config files in networkctl, but
also showing that in log may be useful.

Closes #30483.
This commit is contained in:
Yu Watanabe
2023-12-21 03:37:17 +09:00
parent 935cf7b3a1
commit b993e7e72e
8 changed files with 59 additions and 8 deletions
+12 -2
View File
@@ -1241,10 +1241,20 @@ int link_reconfigure_impl(Link *link, bool force) {
return 0;
if (network) {
_cleanup_free_ char *joined = strv_join(network->dropins, ", ");
if (link->state == LINK_STATE_INITIALIZED)
log_link_info(link, "Configuring with %s.", network->filename);
log_link_info(link, "Configuring with %s%s%s%s.",
network->filename,
isempty(joined) ? "" : " (dropins: ",
joined,
isempty(joined) ? "" : ")");
else
log_link_info(link, "Reconfiguring with %s.", network->filename);
log_link_info(link, "Reconfiguring with %s%s%s%s.",
network->filename,
isempty(joined) ? "" : " (dropins: ",
joined,
isempty(joined) ? "" : ")");
} else
log_link_full(link, link->state == LINK_STATE_INITIALIZED ? LOG_DEBUG : LOG_INFO,
"Unmanaging interface.");