chiark / gitweb /
networkd: don't hard depend on system bus
[elogind.git] / src / network / networkd-manager.c
index 27f806aab2e93f2f54c886d9329720868e2f6823..c630ed7ed91aa6bae261a7ae5f3694a01aa5b4b6 100644 (file)
@@ -55,7 +55,7 @@ int manager_new(Manager **ret) {
                 return r;
 
         r = sd_bus_default_system(&m->bus);
-        if (r < 0)
+        if (r < 0 && r != -ENOENT) /* TODO: drop when we can rely on kdbus */
                 return r;
 
         m->udev = udev_new();
@@ -288,6 +288,11 @@ int manager_rtnl_listen(Manager *m) {
 int manager_bus_listen(Manager *m) {
         int r;
 
+        assert(m->event);
+
+        if (!m->bus) /* TODO: drop when we can rely on kdbus */
+                return 0;
+
         r = sd_bus_attach_event(m->bus, m->event, 0);
         if (r < 0)
                 return r;
@@ -334,11 +339,11 @@ int manager_update_resolv_conf(Manager *m) {
 
         fchmod(fileno(f), 0644);
 
-        fputs("# This file is managed by systemd-networkd(8). Do not edit.\n#\n", f);
-        fputs("# Third party programs must not access this file directly, but\n", f);
-        fputs("# only through the symlink at /etc/resolv.conf. To manage your\n", f);
-        fputs("# own static resolv.conf(5), replace the symlink by a static\n", f);
-        fputs("# file at /etc/resolv.conf.\n\n", f);
+        fputs("# This file is managed by systemd-networkd(8). Do not edit.\n#\n"
+              "# Third party programs must not access this file directly, but\n"
+              "# only through the symlink at /etc/resolv.conf. To manage\n"
+              "# resolv.conf(5) in a different way, replace the symlink by a\n"
+              "# static file or a different symlink.\n\n", f);
 
         HASHMAP_FOREACH(link, m->links, i) {
                 if (link->dhcp) {