From 82c1ed39794ecafc32b71dc83cf11abbbbb26037 Mon Sep 17 00:00:00 2001 From: Daniel Schaal Date: Sun, 16 Mar 2014 06:06:43 +0100 Subject: [PATCH] enable systemd integration --- debian/control | 4 ++-- .../patches/remove-syslog.target-reference.patch | 14 ++++++++++++++ debian/patches/series | 1 + debian/rules | 7 ++++++- 4 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 debian/patches/remove-syslog.target-reference.patch diff --git a/debian/control b/debian/control index a3320353..0e621e60 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: fail2ban Section: net Priority: optional Maintainer: Yaroslav Halchenko -Build-Depends: debhelper (>= 9), python (>= 2.6.6-3~), python-pyinotify +Build-Depends: debhelper (>= 9), python (>= 2.6.6-3~), python-pyinotify, dh-systemd Homepage: http://www.fail2ban.org Vcs-Git: git://github.com/fail2ban/fail2ban.git Vcs-Browser: http://github.com/fail2ban/fail2ban @@ -13,7 +13,7 @@ Package: fail2ban Architecture: all Depends: ${python:Depends}, ${misc:Depends}, lsb-base (>=2.0-7) Recommends: iptables, whois, python-pyinotify -Suggests: python-gamin, mailx, system-log-daemon +Suggests: python-gamin, mailx, system-log-daemon, python-systemd Description: ban hosts that cause multiple authentication errors Fail2ban monitors log files (e.g. /var/log/auth.log, /var/log/apache/access.log) and temporarily or persistently bans diff --git a/debian/patches/remove-syslog.target-reference.patch b/debian/patches/remove-syslog.target-reference.patch new file mode 100644 index 00000000..57e73cde --- /dev/null +++ b/debian/patches/remove-syslog.target-reference.patch @@ -0,0 +1,14 @@ +Description: Don't mention obsolete syslog.target in systemd service file +Author: Daniel Schaal +Last-Update: 2014-03-15 + +--- fail2ban-0.9.0.orig/files/fail2ban.service ++++ fail2ban-0.9.0/files/fail2ban.service +@@ -1,6 +1,6 @@ + [Unit] + Description=Fail2ban Service +-After=syslog.target network.target ++After=network.target + + [Service] + Type=forking diff --git a/debian/patches/series b/debian/patches/series index b7728eee..1be59357 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ deb_manpages_reportbug +remove-syslog.target-reference.patch diff --git a/debian/rules b/debian/rules index ffb317e5..41f04242 100755 --- a/debian/rules +++ b/debian/rules @@ -10,7 +10,7 @@ #export DH_VERBOSE=1 %: - dh $@ --with python2 + dh $@ --with python2,systemd DESTDIR=$(CURDIR)/debian/fail2ban @@ -30,6 +30,11 @@ override_dh_install: # Install bash completion install -d $(DESTDIR)/etc/bash_completion.d install -m 644 files/bash-completion $(DESTDIR)/etc/bash_completion.d/fail2ban + # Install systemd files + install -d $(DESTDIR)/lib/systemd/system + install -d $(DESTDIR)/usr/lib/tmpfiles.d + install -m 644 files/fail2ban.service $(DESTDIR)/lib/systemd/system + install -m 644 files/fail2ban-tmpfiles.conf $(DESTDIR)/usr/lib/tmpfiles.d dh_install