mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-30 10:53:11 +00:00
Shorten filenames of start scripts to make log messages more readable
This commit is contained in:
parent
ae62436697
commit
02e37ba6b0
@ -255,6 +255,8 @@ let
|
||||
KillSignal=SIGHUP
|
||||
'';
|
||||
|
||||
makeJobScript = name: content: "${pkgs.writeScriptBin name content}/bin/${name}";
|
||||
|
||||
serviceToUnit = name: def:
|
||||
{ inherit (def) wantedBy;
|
||||
|
||||
@ -274,14 +276,14 @@ let
|
||||
${concatMapStrings (n: "Environment=${n}=${getAttr n def.environment}\n") (attrNames def.environment)}
|
||||
|
||||
${optionalString (def.preStart != "") ''
|
||||
ExecStartPre=${pkgs.writeScript "${name}-prestart.sh" ''
|
||||
ExecStartPre=${makeJobScript "${name}-prestart.sh" ''
|
||||
#! ${pkgs.stdenv.shell} -e
|
||||
${def.preStart}
|
||||
''}
|
||||
''}
|
||||
|
||||
${optionalString (def.script != "") ''
|
||||
ExecStart=${pkgs.writeScript "${name}.sh" ''
|
||||
ExecStart=${makeJobScript "${name}.sh" ''
|
||||
#! ${pkgs.stdenv.shell} -e
|
||||
${def.script}
|
||||
''}
|
||||
|
@ -12,6 +12,8 @@ let
|
||||
groupExists = g:
|
||||
(g == "") || any (gg: gg.name == g) (attrValues config.users.extraGroups);
|
||||
|
||||
makeJobScript = name: content: "${pkgs.writeScriptBin name content}/bin/${name}";
|
||||
|
||||
# From a job description, generate an systemd unit file.
|
||||
makeUnit = job:
|
||||
|
||||
@ -20,13 +22,13 @@ let
|
||||
|
||||
env = config.system.upstartEnvironment // job.environment;
|
||||
|
||||
preStartScript = pkgs.writeScript "${job.name}-pre-start.sh"
|
||||
preStartScript = makeJobScript "${job.name}-pre-start.sh"
|
||||
''
|
||||
#! ${pkgs.stdenv.shell} -e
|
||||
${job.preStart}
|
||||
'';
|
||||
|
||||
startScript = pkgs.writeScript "${job.name}-start.sh"
|
||||
startScript = makeJobScript "${job.name}-start.sh"
|
||||
''
|
||||
#! ${pkgs.stdenv.shell} -e
|
||||
${if job.script != "" then job.script else ''
|
||||
@ -34,19 +36,19 @@ let
|
||||
''}
|
||||
'';
|
||||
|
||||
postStartScript = pkgs.writeScript "${job.name}-post-start.sh"
|
||||
postStartScript = makeJobScript "${job.name}-post-start.sh"
|
||||
''
|
||||
#! ${pkgs.stdenv.shell} -e
|
||||
${job.postStart}
|
||||
'';
|
||||
|
||||
preStopScript = pkgs.writeScript "${job.name}-pre-stop.sh"
|
||||
preStopScript = makeJobScript "${job.name}-pre-stop.sh"
|
||||
''
|
||||
#! ${pkgs.stdenv.shell} -e
|
||||
${job.preStop}
|
||||
'';
|
||||
|
||||
postStopScript = pkgs.writeScript "${job.name}-post-stop.sh"
|
||||
postStopScript = makeJobScript "${job.name}-post-stop.sh"
|
||||
''
|
||||
#! ${pkgs.stdenv.shell} -e
|
||||
${job.postStop}
|
||||
|
Loading…
Reference in New Issue
Block a user