about summary refs log tree commit diff
path: root/nixos/modules/services/monitoring/monit.nix
diff options
context:
space:
mode:
authorAlexander Ried <ried@mytum.de>2016-09-12 16:31:18 +0200
committerAlexander Ried <ried@mytum.de>2016-09-13 11:19:22 +0200
commit23ca90b0132a8f2be2575a832a0d4e0aa5a2137f (patch)
treeabf40c551291dcb94f016078ecf441a8afd137d3 /nixos/modules/services/monitoring/monit.nix
parentfbf0abf4af3c5c5cc2366488f8867bf858cff741 (diff)
downloadnixlib-23ca90b0132a8f2be2575a832a0d4e0aa5a2137f.tar
nixlib-23ca90b0132a8f2be2575a832a0d4e0aa5a2137f.tar.gz
nixlib-23ca90b0132a8f2be2575a832a0d4e0aa5a2137f.tar.bz2
nixlib-23ca90b0132a8f2be2575a832a0d4e0aa5a2137f.tar.lz
nixlib-23ca90b0132a8f2be2575a832a0d4e0aa5a2137f.tar.xz
nixlib-23ca90b0132a8f2be2575a832a0d4e0aa5a2137f.tar.zst
nixlib-23ca90b0132a8f2be2575a832a0d4e0aa5a2137f.zip
monitoring.monit: get closer to upstream service definition
taken from
https://bitbucket.org/tildeslash/monit/src/e02247e0480b19be88e6a908886da83bbb1bc6a3/system/startup/monit.service.in?at=master
Diffstat (limited to 'nixos/modules/services/monitoring/monit.nix')
-rw-r--r--nixos/modules/services/monitoring/monit.nix13
1 files changed, 9 insertions, 4 deletions
diff --git a/nixos/modules/services/monitoring/monit.nix b/nixos/modules/services/monitoring/monit.nix
index 704693969a35..e07ffd2e8b54 100644
--- a/nixos/modules/services/monitoring/monit.nix
+++ b/nixos/modules/services/monitoring/monit.nix
@@ -36,11 +36,16 @@ in
     ];
 
     systemd.services.monit = {
-      description = "Monit system watcher";
-      after = [ "network-interfaces.target" ];
+      description = "Pro-active monitoring utility for unix systems";
+      after = [ "network.target" ];
       wantedBy = [ "multi-user.target" ];
-      script = "${pkgs.monit}/bin/monit -I -c /etc/monit.conf";
-      serviceConfig.Restart = "always";
+      serviceConfig = {
+        ExecStart = "${pkgs.monit}/bin/monit -I -c /etc/monit.conf";
+        ExecStop = "${pkgs.monit}/bin/monit -c /etc/monit.conf quit";
+        ExecReload = "${pkgs.monit}/bin/monit -c /etc/monit.conf reload";
+        KillMode = "process";
+        Restart = "always";
+      };
     };
   };
 }