Unverified Commit 135fbd12 authored by Florian Klink's avatar Florian Klink Committed by GitHub
Browse files

Merge pull request #309068 from SuperSandro2000/dbus-broker

nixos/dbus: fix switching from dbus-broker to dbus
parents 7142a2de 21ab17de
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -147,6 +147,10 @@ in
      };

      systemd.services.dbus = {
        aliases = [
          # hack aiding to prevent dbus from restarting when switching from dbus-broker back to dbus
          "dbus-broker.service"
        ];
        # Don't restart dbus-daemon. Bad things tend to happen if we do.
        reloadIfChanged = true;
        restartTriggers = [
@@ -158,6 +162,10 @@ in
      };

      systemd.user.services.dbus = {
        aliases = [
          # hack aiding to prevent dbus from restarting when switching from dbus-broker back to dbus
          "dbus-broker.service"
        ];
        # Don't restart dbus-daemon. Bad things tend to happen if we do.
        reloadIfChanged = true;
        restartTriggers = [
@@ -184,6 +192,8 @@ in
      # https://github.com/NixOS/nixpkgs/issues/108643
      systemd.services.dbus-broker = {
        aliases = [
          # allow other services to just depend on dbus,
          # but also a hack aiding to prevent dbus from restarting when switching from dbus-broker back to dbus
          "dbus.service"
        ];
        unitConfig = {
@@ -203,6 +213,8 @@ in

      systemd.user.services.dbus-broker = {
        aliases = [
          # allow other services to just depend on dbus,
          # but also a hack aiding to prevent dbus from restarting when switching from dbus-broker back to dbus
          "dbus.service"
        ];
        # Don't restart dbus. Bad things tend to happen if we do.
+3 −0
Original line number Diff line number Diff line
@@ -472,6 +472,9 @@ sub handle_modified_unit { ## no critic(Subroutines::ProhibitManyArgs, Subroutin
            $units_to_reload->{$unit} = 1;
            record_unit($reload_list_file, $unit);
        }
        elsif ($unit eq "dbus.service" || $unit eq "dbus-broker.service") {
            # dbus service should only ever be reloaded, not started/stoped/restarted as that would break the system.
        }
        elsif (!parse_systemd_bool(\%new_unit_info, "Service", "X-RestartIfChanged", 1) || parse_systemd_bool(\%new_unit_info, "Unit", "RefuseManualStop", 0) || parse_systemd_bool(\%new_unit_info, "Unit", "X-OnlyManualStart", 0)) {
            $units_to_skip->{$unit} = 1;
        } else {