mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-11 10:22:54 +08:00
nixos/slurm: add extraFlags option to slurmctld service
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
lib,
|
||||
options,
|
||||
pkgs,
|
||||
utils,
|
||||
...
|
||||
}:
|
||||
let
|
||||
@@ -83,6 +84,28 @@ in
|
||||
slurm to work properly (see `services.munge.password`).
|
||||
'';
|
||||
};
|
||||
|
||||
flags = lib.mkOption {
|
||||
type = lib.types.attrsOf (
|
||||
lib.types.oneOf [
|
||||
lib.types.str
|
||||
lib.types.bool
|
||||
lib.types.float
|
||||
lib.types.int
|
||||
]
|
||||
);
|
||||
default = { };
|
||||
example = {
|
||||
"i" = true;
|
||||
"systemd" = true;
|
||||
"L" = "/var/log/file with space.log";
|
||||
"n" = 10;
|
||||
};
|
||||
description = ''
|
||||
Flags passed to `slurmctld` daemon, see {manpage}`slurmctld(8)`.
|
||||
Special characters are properly escaped.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
dbdserver = {
|
||||
@@ -484,7 +507,17 @@ in
|
||||
|
||||
serviceConfig = {
|
||||
Type = "forking";
|
||||
ExecStart = "${wrappedSlurm}/bin/slurmctld";
|
||||
ExecStart =
|
||||
let
|
||||
isLong = optionName: builtins.stringLength optionName > 1;
|
||||
flagFormat = optionName: {
|
||||
option = if isLong optionName then "--${optionName}" else "-${optionName}";
|
||||
sep = null;
|
||||
explicitBool = false;
|
||||
};
|
||||
cli = [ "${wrappedSlurm}/bin/slurmctld" ] ++ lib.cli.toCommandLine flagFormat cfg.server.flags;
|
||||
in
|
||||
utils.escapeSystemdExecArgs cli;
|
||||
PIDFile = "/run/slurmctld.pid";
|
||||
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user