From f892d43b47fe4a9c58e890af2e3bf8e25e912ec8 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Thu, 27 Jul 2023 14:24:21 +0200 Subject: [PATCH] Kill slurmd remaining processes on upgrade --- m/common/slurm.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/m/common/slurm.nix b/m/common/slurm.nix index 08de3fd..b02a914 100644 --- a/m/common/slurm.nix +++ b/m/common/slurm.nix @@ -1,6 +1,14 @@ -{ ... }: +{ lib, ... }: { + systemd.services.slurmd.serviceConfig = { + # Kill all processes in the control group on stop/restart. This will kill + # all the jobs running, so ensure that we only upgrade when the nodes are + # not in use. See: + # https://github.com/NixOS/nixpkgs/commit/ae93ed0f0d4e7be0a286d1fca86446318c0c6ffb + # https://bugs.schedmd.com/show_bug.cgi?id=2095#c24 + KillMode = lib.mkForce "control-group"; + }; services.slurm = { client.enable = true; controlMachine = "hut";