From 270da0a11582ba036dadc974a8ce51475c529c40 Mon Sep 17 00:00:00 2001 From: Markus Kowalewski Date: Mon, 31 Jan 2022 23:08:55 +0100 Subject: nixos/slurm: fix startup of slurmd * make slurmd depend on network target to ensure basic networking is available on startup. This fixes behaviour where slurmd fails with "error: get_addr_info: getaddrinfo() failed". * Use tmpfiles.d to ensure spool directory exists on start up. --- nixos/modules/services/computing/slurm/slurm.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'nixos/modules/services/computing') diff --git a/nixos/modules/services/computing/slurm/slurm.nix b/nixos/modules/services/computing/slurm/slurm.nix index 7686ff99bfc0..8cbe54c60604 100644 --- a/nixos/modules/services/computing/slurm/slurm.nix +++ b/nixos/modules/services/computing/slurm/slurm.nix @@ -362,6 +362,7 @@ in wantedBy = [ "multi-user.target" ]; after = [ "systemd-tmpfiles-clean.service" ]; + requires = [ "network.target" ]; serviceConfig = { Type = "forking"; @@ -371,12 +372,12 @@ in ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; LimitMEMLOCK = "infinity"; }; - - preStart = '' - mkdir -p /var/spool - ''; }; + systemd.tmpfiles.rules = mkIf cfg.client.enable [ + "d /var/spool/slurmd 755 root root -" + ]; + services.openssh.forwardX11 = mkIf cfg.client.enable (mkDefault true); systemd.services.slurmctld = mkIf (cfg.server.enable) { -- cgit 1.4.1