From c4b3e4f5f89b2d5a96a0280e81eaa880c91b075a Mon Sep 17 00:00:00 2001 From: r-vdp Date: Wed, 13 Dec 2023 19:34:23 +0100 Subject: [PATCH] dbus-broker: avoid errors when reloading when /tmp got remounted When reloading the dbus-broker service (e.g. when switching to a new generation), the reload fails when /tmp got remounted after the service had been started. Since the dbus-broker service starts early, and does not have default dependencies, this situation does occur in practice. This change makes sure that if there are mount units for /tmp, dbus-broker gets ordered after them. See also https://github.com/systemd/systemd/issues/28515 --- nixos/modules/services/system/dbus.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nixos/modules/services/system/dbus.nix b/nixos/modules/services/system/dbus.nix index 8d5b25e61762..b47ebc92f93a 100644 --- a/nixos/modules/services/system/dbus.nix +++ b/nixos/modules/services/system/dbus.nix @@ -184,6 +184,11 @@ in aliases = [ "dbus.service" ]; + unitConfig = { + # We get errors when reloading the dbus-broker service + # if /tmp got remounted after this service started + RequiresMountsFor = [ "/tmp" ]; + }; # Don't restart dbus. Bad things tend to happen if we do. reloadIfChanged = true; restartTriggers = [