From deabab8363289c2cd53c039bf3a46f82bda92b5a Mon Sep 17 00:00:00 2001 From: Hector Date: Fri, 27 Oct 2023 06:23:20 +0000 Subject: [PATCH] chore: update example systemd file (!115) - Update the example systemd file to be more complete - Added description, documentation link, and some improved service settings https://gitlab.com/hectorjsmith/fail2ban-prometheus-exporter/-/merge_requests/115 --- _examples/systemd/fail2ban_exporter.service | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/_examples/systemd/fail2ban_exporter.service b/_examples/systemd/fail2ban_exporter.service index db1cf68..27d89b6 100644 --- a/_examples/systemd/fail2ban_exporter.service +++ b/_examples/systemd/fail2ban_exporter.service @@ -1,9 +1,19 @@ [Unit] -Description=Fail2Ban Exporter +Description=Fail2ban metric exporter for Prometheus +Documentation=https://gitlab.com/hectorjsmith/fail2ban-prometheus-exporter/-/blob/main/README.md +Requires=network-online.target +After=network-online.target [Service] -User=fail2ban_exporter ExecStart=/usr/sbin/fail2ban_exporter +Restart=on-failure +RestartSec=5s +NoNewPrivileges=true + +# Currently need to run the exporter as root to ensure it has read/write access to the +# fail2ban socket file. +User=root +Group=root [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target