From 510fba95e84e9b1fc7a96b48bbfc83d7b3b5172e Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Sun, 2 Nov 2014 23:02:45 +0100 Subject: [PATCH] nixos-rebuild: reload dbus before starting other units. Closes #4546 --- nixos/modules/system/activation/switch-to-configuration.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nixos/modules/system/activation/switch-to-configuration.pl b/nixos/modules/system/activation/switch-to-configuration.pl index 12012698efe..c0e0ae23d38 100644 --- a/nixos/modules/system/activation/switch-to-configuration.pl +++ b/nixos/modules/system/activation/switch-to-configuration.pl @@ -321,6 +321,10 @@ 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", "dbus.service"); + # Restart changed services (those that have to be restarted rather # than stopped and started). my @restart = unique(split('\n', read_file($restartListFile, err_mode => 'quiet') // "")); @@ -350,8 +354,6 @@ if (scalar @reload > 0) { unlink($reloadListFile); } -# Signal dbus to reload its configuration. -system("@systemd@/bin/systemctl", "reload", "dbus.service"); # Print failed and new units. my (@failed, @new, @restarting);