summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-manager.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-11-02 10:26:43 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-11-04 18:55:15 +0100
commit6119221afad04a7250c51fe977237c34935a5acb (patch)
tree6b9bc73972284dc75c09925ed4ed2a6f1ad74c41 /src/network/networkd-manager.c
parentnetwork: check if interface is initialized after enumeration completed (diff)
downloadsystemd-6119221afad04a7250c51fe977237c34935a5acb.tar.xz
systemd-6119221afad04a7250c51fe977237c34935a5acb.zip
network: add more debugging logs
This also fixes the position of the logging "Enumeration completed.", and downgrade its log level.
Diffstat (limited to 'src/network/networkd-manager.c')
-rw-r--r--src/network/networkd-manager.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c
index 73e9156e22..476e02fd28 100644
--- a/src/network/networkd-manager.c
+++ b/src/network/networkd-manager.c
@@ -734,6 +734,8 @@ int manager_start(Manager *m) {
assert(m);
+ log_debug("Starting...");
+
(void) sysctl_add_monitor(m);
/* Loading BPF programs requires CAP_SYS_ADMIN and CAP_BPF.
@@ -780,30 +782,34 @@ int manager_start(Manager *m) {
log_link_warning_errno(link, r, "Failed to update link state file %s, ignoring: %m", link->state_file);
}
+ log_debug("Started.");
return 0;
}
int manager_load_config(Manager *m) {
int r;
+ log_debug("Loading...");
+
r = netdev_load(m);
if (r < 0)
- return r;
+ return log_debug_errno(r, "Failed to load .netdev files: %m");
manager_clear_unmanaged_tuntap_fds(m);
r = network_load(m, &m->networks);
if (r < 0)
- return r;
+ return log_debug_errno(r, "Failed to load .network files: %m");
r = manager_build_dhcp_pd_subnet_ids(m);
if (r < 0)
- return r;
+ return log_debug_errno(r, "Failed to build DHCP-PD subnet ID map: %m");
r = manager_build_nexthop_ids(m);
if (r < 0)
- return r;
+ return log_debug_errno(r, "Failed to build nexthop ID map: %m");
+ log_debug("Loaded.");
return 0;
}
@@ -1033,6 +1039,8 @@ static int manager_enumerate_nl80211_mlme(Manager *m) {
int manager_enumerate(Manager *m) {
int r;
+ log_debug("Enumerating...");
+
r = manager_enumerate_links(m);
if (r < 0)
return log_error_errno(r, "Could not enumerate links: %m");
@@ -1094,6 +1102,7 @@ int manager_enumerate(Manager *m) {
else if (r < 0)
return log_error_errno(r, "Could not enumerate wireless LAN stations: %m");
+ log_debug("Enumeration completed.");
return 0;
}
@@ -1195,15 +1204,20 @@ int manager_reload(Manager *m, sd_bus_message *message) {
assert(m);
+ log_debug("Reloading...");
(void) notify_reloading();
r = netdev_reload(m);
- if (r < 0)
+ if (r < 0) {
+ log_debug_errno(r, "Failed to reload .netdev files: %m");
goto finish;
+ }
r = network_reload(m);
- if (r < 0)
+ if (r < 0) {
+ log_debug_errno(r, "Failed to reload .network files: %m");
goto finish;
+ }
HASHMAP_FOREACH(link, m->links_by_index) {
if (message)
@@ -1212,6 +1226,7 @@ int manager_reload(Manager *m, sd_bus_message *message) {
(void) link_reconfigure(link, /* force = */ false);
}
+ log_debug("Reloaded.");
r = 0;
finish:
(void) sd_notify(/* unset= */ false, NOTIFY_READY);