mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-21 04:49:01 +02:00
nixos/prometheus: use ExecStart instead of a shell script
This uses fewer lines of code and one less process.
This commit is contained in:
parent
0333d877c2
commit
a59c92903e
|
@ -662,12 +662,10 @@ in {
|
|||
systemd.services.prometheus = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
script = ''
|
||||
#!/bin/sh
|
||||
exec ${cfg.package}/bin/prometheus \
|
||||
${concatStringsSep " \\\n " cmdlineArgs}
|
||||
'';
|
||||
serviceConfig = {
|
||||
ExecStart = "${cfg.package}/bin/prometheus" +
|
||||
optionalString (length cmdlineArgs != 0) (" \\\n " +
|
||||
concatStringsSep " \\\n " cmdlineArgs);
|
||||
User = promUser;
|
||||
Restart = "always";
|
||||
WorkingDirectory = /var/lib/prometheus;
|
||||
|
@ -679,12 +677,10 @@ in {
|
|||
systemd.services.prometheus2 = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
script = ''
|
||||
#!/bin/sh
|
||||
exec ${cfg2.package}/bin/prometheus \
|
||||
${concatStringsSep " \\\n " cmdlineArgs2}
|
||||
'';
|
||||
serviceConfig = {
|
||||
ExecStart = "${cfg2.package}/bin/prometheus" +
|
||||
optionalString (length cmdlineArgs2 != 0) (" \\\n " +
|
||||
concatStringsSep " \\\n " cmdlineArgs2);
|
||||
User = promUser;
|
||||
Restart = "always";
|
||||
WorkingDirectory = /var/lib/prometheus2;
|
||||
|
|
Loading…
Reference in a new issue