diff options
Diffstat (limited to 'nixos/modules/system/activation/switch-to-configuration.pl')
-rw-r--r-- | nixos/modules/system/activation/switch-to-configuration.pl | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/nixos/modules/system/activation/switch-to-configuration.pl b/nixos/modules/system/activation/switch-to-configuration.pl index ce36bac2bdc..7aa4b12a654 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); |