summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-04-01 16:28:18 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-04-01 16:57:16 +0200
commit1c39a47ac87959b2589ef797e519af96d73c27d6 (patch)
tree1c1b5f74e678fd7406f110615f0ed615d9f4566d /nixos
parentb3e1021b41b710240bfdacd7c4603acf2029237d (diff)
downloadnixlib-1c39a47ac87959b2589ef797e519af96d73c27d6.tar
nixlib-1c39a47ac87959b2589ef797e519af96d73c27d6.tar.gz
nixlib-1c39a47ac87959b2589ef797e519af96d73c27d6.tar.bz2
nixlib-1c39a47ac87959b2589ef797e519af96d73c27d6.tar.lz
nixlib-1c39a47ac87959b2589ef797e519af96d73c27d6.tar.xz
nixlib-1c39a47ac87959b2589ef797e519af96d73c27d6.tar.zst
nixlib-1c39a47ac87959b2589ef797e519af96d73c27d6.zip
Reload, don't restart, dbus.service
Many bus clients get hopelessly confused when dbus-daemon is
restarted. So let's not do that.

Of course, this is not ideal either, because we end up stuck with a
possibly outdated dbus-daemon. But that issue will become irrelevant
in the glorious kdbus-based future.

Hopefully this also gets rid of systemd getting stuck after
dbus-daemon is restarted:

Apr 01 15:37:50 mandark systemd[1]: Failed to register match for Disconnected message: Connection timed out
Apr 01 15:37:50 mandark systemd[1]: Looping too fast. Throttling execution a little.
Apr 01 15:37:51 mandark systemd[1]: Looping too fast. Throttling execution a little.
...
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/system/dbus.nix3
-rw-r--r--nixos/modules/system/activation/switch-to-configuration.pl18
2 files changed, 10 insertions, 11 deletions
diff --git a/nixos/modules/services/system/dbus.nix b/nixos/modules/services/system/dbus.nix
index 928f16c94489..d40f7d6d05d9 100644
--- a/nixos/modules/services/system/dbus.nix
+++ b/nixos/modules/services/system/dbus.nix
@@ -130,6 +130,9 @@ in
         config.system.path
       ];
 
+    # Don't restart dbus-daemon. Bad things tend to happen if we do.
+    systemd.services.dbus.reloadIfChanged = true;
+
     environment.pathsToLink = [ "/etc/dbus-1" "/share/dbus-1" ];
 
   };
diff --git a/nixos/modules/system/activation/switch-to-configuration.pl b/nixos/modules/system/activation/switch-to-configuration.pl
index ce36bac2bdcf..7aa4b12a6543 100644
--- a/nixos/modules/system/activation/switch-to-configuration.pl
+++ b/nixos/modules/system/activation/switch-to-configuration.pl
@@ -384,9 +384,13 @@ system("@systemd@/bin/systemctl", "reset-failed");
 # Make systemd reload its units.
 system("@systemd@/bin/systemctl", "daemon-reload") == 0 or $res = 3;
 
-# Signal dbus to reload its configuration before starting other units.
-# Other units may rely on newly installed policy files under /etc/dbus-1
-system("@systemd@/bin/systemctl", "reload-or-restart", "dbus.service");
+# Reload units that need it. This includes remounting changed mount
+# units.
+if (scalar(keys %unitsToReload) > 0) {
+    print STDERR "reloading the following units: ", join(", ", sort(keys %unitsToReload)), "\n";
+    system("@systemd@/bin/systemctl", "reload", "--", sort(keys %unitsToReload)) == 0 or $res = 4;
+    unlink($reloadListFile);
+}
 
 # Restart changed services (those that have to be restarted rather
 # than stopped and started).
@@ -407,14 +411,6 @@ print STDERR "starting the following units: ", join(", ", @unitsToStartFiltered)
 system("@systemd@/bin/systemctl", "start", "--", sort(keys %unitsToStart)) == 0 or $res = 4;
 unlink($startListFile);
 
-# Reload units that need it.  This includes remounting changed mount
-# units.
-if (scalar(keys %unitsToReload) > 0) {
-    print STDERR "reloading the following units: ", join(", ", sort(keys %unitsToReload)), "\n";
-    system("@systemd@/bin/systemctl", "reload", "--", sort(keys %unitsToReload)) == 0 or $res = 4;
-    unlink($reloadListFile);
-}
-
 
 # Print failed and new units.
 my (@failed, @new, @restarting);