From c5f6a0875096c1904d95146767f0f01f521614e8 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Thu, 25 Jul 2013 15:40:20 +0200 Subject: [PATCH] Make fail2ban a normal systemd service in nixos module. --- modules/services/security/fail2ban.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/services/security/fail2ban.nix b/modules/services/security/fail2ban.nix index 3c3519a9db7..d90cf8d4471 100644 --- a/modules/services/security/fail2ban.nix +++ b/modules/services/security/fail2ban.nix @@ -98,11 +98,12 @@ in } ]; - jobs.fail2ban = + systemd.services.fail2ban = { description = "Fail2ban intrusion prevention system"; + + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; - startOn = "started networking"; - path = [ pkgs.fail2ban pkgs.iptables ]; preStart = @@ -113,7 +114,7 @@ in mkdir -p /var/run/fail2ban -m 0755 ''; - exec = "fail2ban-server -f"; + serviceConfig.ExecStart = "${pkgs.fail2ban}/bin/fail2ban-server -f"; postStart = ''