summary refs log tree commit diff
path: root/nixos/modules/services/networking/smokeping.nix
diff options
context:
space:
mode:
authorNiklas Hambüchen <mail@nh2.me>2019-01-09 13:13:55 +0100
committerKerstin <kerstin@erictapen.name>2021-11-01 23:20:40 +0100
commit0a2103547f1c27ed79a81e3c3b735bf1bdf3d2a7 (patch)
tree43a60d9a1214b5186a7ac2f37125cdc5042a4d52 /nixos/modules/services/networking/smokeping.nix
parentf0f12b2ad07ee65fb0b245996b47e9e8bca32525 (diff)
downloadnixpkgs-0a2103547f1c27ed79a81e3c3b735bf1bdf3d2a7.tar
nixpkgs-0a2103547f1c27ed79a81e3c3b735bf1bdf3d2a7.tar.gz
nixpkgs-0a2103547f1c27ed79a81e3c3b735bf1bdf3d2a7.tar.bz2
nixpkgs-0a2103547f1c27ed79a81e3c3b735bf1bdf3d2a7.tar.lz
nixpkgs-0a2103547f1c27ed79a81e3c3b735bf1bdf3d2a7.tar.xz
nixpkgs-0a2103547f1c27ed79a81e3c3b735bf1bdf3d2a7.tar.zst
nixpkgs-0a2103547f1c27ed79a81e3c3b735bf1bdf3d2a7.zip
nixos/smokeping: Remove bash wrapper, refactor.
The bash wrapper process served no purpose, and systemd directly controlling the
processes is more reliable / more responsive to systemctl commands.
Diffstat (limited to 'nixos/modules/services/networking/smokeping.nix')
-rw-r--r--nixos/modules/services/networking/smokeping.nix15
1 files changed, 12 insertions, 3 deletions
diff --git a/nixos/modules/services/networking/smokeping.nix b/nixos/modules/services/networking/smokeping.nix
index 021368488a3..6b550f4d000 100644
--- a/nixos/modules/services/networking/smokeping.nix
+++ b/nixos/modules/services/networking/smokeping.nix
@@ -301,6 +301,7 @@ in
       serviceConfig = {
         User = cfg.user;
         Restart = "on-failure";
+        ExecStart = "${cfg.package}/bin/smokeping --config=${configPath} --nodaemon";
       };
       preStart = ''
         mkdir -m 0755 -p ${smokepingHome}/cache ${smokepingHome}/data
@@ -311,15 +312,23 @@ in
         ${cfg.package}/bin/smokeping --check --config=${configPath}
         ${cfg.package}/bin/smokeping --static --config=${configPath}
       '';
-      script = "${cfg.package}/bin/smokeping --config=${configPath} --nodaemon";
     };
     systemd.services.thttpd = mkIf cfg.webService {
       wantedBy = [ "multi-user.target"];
       requires = [ "smokeping.service"];
       partOf = [ "smokeping.service"];
       path = with pkgs; [ bash rrdtool smokeping thttpd ];
-      script = ''thttpd -u ${cfg.user} -c "**.fcgi" -d ${smokepingHome} -p ${builtins.toString cfg.port} -D -nos'';
-      serviceConfig.Restart = "always";
+      serviceConfig = {
+        Restart = "always";
+        ExecStart = lib.concatStringsSep " " (lib.concatLists [
+          [ "${pkgs.thttpd}/bin/thttpd" ]
+          [ "-u ${cfg.user}" ]
+          [ ''-c "**.fcgi"'' ]
+          [ "-d ${smokepingHome}" ]
+          [ "-p ${builtins.toString cfg.port}" ]
+          [ "-D -nos" ]
+        ]);
+      };
     };
   };