diff options
-rw-r--r-- | src/network/networkd-link.c | 2 | ||||
-rw-r--r-- | src/network/networkd.c | 31 |
2 files changed, 24 insertions, 9 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 993931d1cd..8960b60ab1 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -580,6 +580,7 @@ static int link_update_flags(Link *link, unsigned flags) { if (link->network->dhcp) { r = link_acquire_conf(link); if (r < 0) { + log_warning_link(link, "Could not acquire DHCPv4 lease: %s", strerror(-r)); link_enter_failed(link); return r; } @@ -590,6 +591,7 @@ static int link_update_flags(Link *link, unsigned flags) { if (link->network->dhcp) { r = sd_dhcp_client_stop(link->dhcp); if (r < 0) { + log_warning_link(link, "Could not stop DHCPv4 client: %s", strerror(-r)); link_enter_failed(link); return r; } diff --git a/src/network/networkd.c b/src/network/networkd.c index 055200cb00..0e3892007f 100644 --- a/src/network/networkd.c +++ b/src/network/networkd.c @@ -41,39 +41,52 @@ int main(int argc, char *argv[]) { } r = manager_new(&m); - if (r < 0) + if (r < 0) { + log_error("Could not create manager: %s", strerror(-r)); goto out; + } r = manager_load_config(m); - if (r < 0) - return EXIT_FAILURE; + if (r < 0) { + log_error("Could not load configuration files: %s", strerror(-r)); + goto out; + } r = manager_udev_listen(m); - if (r < 0) + if (r < 0) { + log_error("Could not connect to udev: %s", strerror(-r)); goto out; + } r = manager_udev_enumerate_links(m); - if (r < 0) + if (r < 0) { + log_error("Could not enumerate links: %s", strerror(-r)); goto out; + } r = manager_rtnl_listen(m); - if (r < 0) + if (r < 0) { + log_error("Could not connect to rtnl: %s", strerror(-r)); goto out; - + } /* write out empty resolv.conf to avoid a * dangling symlink */ r = manager_update_resolv_conf(m); - if (r < 0) + if (r < 0) { + log_error("Could not create resolv.conf: %s", strerror(-r)); goto out; + } sd_notify(false, "READY=1\n" "STATUS=Processing requests..."); r = sd_event_loop(m->event); - if (r < 0) + if (r < 0) { + log_error("Event loop failed: %s", strerror(-r)); goto out; + } out: sd_notify(false, |