@@ -36,11 +36,16 @@ in
3636 ];
3737
3838 systemd.services.monit = {
39− description = "Monit system watcher";
40− after = [ "network-interfaces.target" ];
39+ description = "Pro-active monitoring utility for unix systems";
40+ after = [ "network.target" ];
4141 wantedBy = [ "multi-user.target" ];
42− script = "${pkgs.monit}/bin/monit -I -c /etc/monit.conf";
43− serviceConfig.Restart = "always";
42+ serviceConfig = {
43+ ExecStart = "${pkgs.monit}/bin/monit -I -c /etc/monit.conf";
44+ ExecStop = "${pkgs.monit}/bin/monit -c /etc/monit.conf quit";
45+ ExecReload = "${pkgs.monit}/bin/monit -c /etc/monit.conf reload";
46+ KillMode = "process";
47+ Restart = "always";
48+ };
4449 };
4550 };
4651}