Unverified Commit 2f5b053b authored by r-vdp's avatar r-vdp
Browse files

switch-to-configuration-ng: Document ExecReload reload semantics

Update the compare_units doc comment and add a release-notes entry
covering the new reload-instead-of-restart behaviour.
parent da43acd6
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -347,6 +347,8 @@ See <https://github.com/NixOS/nixpkgs/issues/481673>.

<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->

- `switch-to-configuration` now reloads a service instead of restarting it when the only change to its unit is `ExecReload=`, and takes no action when `ExecReload=` is removed. Previously both cases triggered a restart.

- [`hardware.nvidia.branch`](#opt-hardware.nvidia.branch) was added to select the NVIDIA driver branch; setting [`hardware.nvidia.package`](#opt-hardware.nvidia.package) overrides this.

- The NixOS NVIDIA module wiring has been updated to match the new `nvidia-x11` output layout.
+4 −3
Original line number Diff line number Diff line
@@ -489,9 +489,10 @@ enum UnitComparison {

// Compare the contents of two unit files and return whether the unit needs to be restarted or
// reloaded. If the units differ, the service is restarted unless the only difference is
// `X-Reload-Triggers` in the `Unit` section. If this is the only modification, the unit is
// reloaded instead of restarted. If the only difference is `Options` in the `[Mount]` section, the
// unit is reloaded rather than restarted.
// `X-Reload-Triggers` in the `[Unit]` section, `Options` in the `[Mount]` section, or `ExecReload`
// in the `[Service]` section, in which case the unit is reloaded rather than restarted. Removing
// `ExecReload` is treated as a no-op since the running process is unaffected and the new unit can
// no longer be reloaded.
fn compare_units(current_unit: &UnitInfo, new_unit: &UnitInfo) -> UnitComparison {
    let mut ret = UnitComparison::Equal;