Check for systemd environment variables that are too long
Issue #3403. For the case of $PATH being too long, we could call buildEnv automatically.
This commit is contained in:
parent
6479d6fea4
commit
9956b97b2f
@ -317,7 +317,9 @@ let
|
|||||||
''
|
''
|
||||||
[Service]
|
[Service]
|
||||||
${let env = cfg.globalEnvironment // def.environment;
|
${let env = cfg.globalEnvironment // def.environment;
|
||||||
in concatMapStrings (n: "Environment=\"${n}=${getAttr n env}\"\n") (attrNames env)}
|
in concatMapStrings (n:
|
||||||
|
let s = "Environment=\"${n}=${getAttr n env}\"\n";
|
||||||
|
in if stringLength s >= 2048 then throw "The value of the environment variable ‘${n}’ in systemd service ‘${name}.service’ is too long." else s) (attrNames env)}
|
||||||
${if def.reloadIfChanged then ''
|
${if def.reloadIfChanged then ''
|
||||||
X-ReloadIfChanged=true
|
X-ReloadIfChanged=true
|
||||||
'' else if !def.restartIfChanged then ''
|
'' else if !def.restartIfChanged then ''
|
||||||
|
Loading…
Reference in New Issue
Block a user