From 52d3648cb0c8f0aa480ec980d32e71d867de3b89 Mon Sep 17 00:00:00 2001 From: Hector Date: Sun, 20 Feb 2022 08:58:43 +0000 Subject: [PATCH 1/2] feat: add example systemd service file Add a basic systemd service file to serve as an example on how to run the exporter as a system service. Add short README with an overview of the service file. --- examples/systemd/README.md | 8 ++++++++ examples/systemd/fail2ban_exporter.service | 9 +++++++++ 2 files changed, 17 insertions(+) create mode 100644 examples/systemd/README.md create mode 100644 examples/systemd/fail2ban_exporter.service diff --git a/examples/systemd/README.md b/examples/systemd/README.md new file mode 100644 index 0000000..e6efcbf --- /dev/null +++ b/examples/systemd/README.md @@ -0,0 +1,8 @@ +# Systemd + +The `.service` file in this directory is to be put into `/etc/systemd/system`. +It expects the binary file to be installed at `/usr/sbin/fail2ban_exporter`. +It expects a user named `fail2ban_exporter` to exist. +This user should not have a shell or any special privileges aside from read-access to the fail2ban socket file. + +The `ExecStart` line can be modified to add any custom CLI flags. diff --git a/examples/systemd/fail2ban_exporter.service b/examples/systemd/fail2ban_exporter.service new file mode 100644 index 0000000..db1cf68 --- /dev/null +++ b/examples/systemd/fail2ban_exporter.service @@ -0,0 +1,9 @@ +[Unit] +Description=Fail2Ban Exporter + +[Service] +User=fail2ban_exporter +ExecStart=/usr/sbin/fail2ban_exporter + +[Install] +WantedBy=multi-user.target \ No newline at end of file From 8fef00e6f7905d0f71208debd61cbef19098acca Mon Sep 17 00:00:00 2001 From: Hector Date: Sun, 20 Feb 2022 09:02:24 +0000 Subject: [PATCH 2/2] tweak wording and formatting --- examples/systemd/README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/systemd/README.md b/examples/systemd/README.md index e6efcbf..52d25c3 100644 --- a/examples/systemd/README.md +++ b/examples/systemd/README.md @@ -1,8 +1,7 @@ # Systemd -The `.service` file in this directory is to be put into `/etc/systemd/system`. -It expects the binary file to be installed at `/usr/sbin/fail2ban_exporter`. -It expects a user named `fail2ban_exporter` to exist. -This user should not have a shell or any special privileges aside from read-access to the fail2ban socket file. +The `.service` file in this directory should be copied to the `/etc/systemd/system/` folder. +- It expects the binary file to be installed at `/usr/sbin/fail2ban_exporter`. +- It expects a user named `fail2ban_exporter` to exist. This user should not have a shell or any special privileges aside from read-access to the fail2ban socket file. The `ExecStart` line can be modified to add any custom CLI flags.