You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

249 lines
6.6 KiB
Plaintext

7 years ago
#! /bin/sh
### BEGIN INIT INFO
# Provides: fail2ban
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $time $network $syslog $named iptables firehol shorewall ipmasq arno-iptables-firewall iptables-persistent ferm ufw
# Should-Stop: $network $syslog $named iptables firehol shorewall ipmasq arno-iptables-firewall iptables-persistent ferm ufw
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop fail2ban
# Description: Start/stop fail2ban, a daemon scanning the log files and
# banning potential attackers.
### END INIT INFO
# Author: Aaron Isotton <aaron@isotton.com>
# Modified: by Yaroslav Halchenko <debian@onerussian.com>
# reindented + minor corrections + to work on sarge without modifications
# Modified: by Glenn Aaldering <glenn@openvideo.nl>
# added exit codes for status command
# Modified: by Juan Karlo de Guzman <jkarlodg@gmail.com>
# corrected the DAEMON's path and the SOCKFILE
# rename this file: (sudo) mv /etc/init.d/fail2ban.init /etc/init.d/fail2ban
# same with the logrotate file: (sudo) mv /etc/logrotate.d/fail2ban.logrotate /etc/logrotate.d/fail2ban
#
committing changes in /etc after apt run Package changes: -adduser 3.116 all +adduser 3.117 all -apt 1.6~alpha3 armhf -apt-listchanges 3.14 all -apt-utils 1.6~alpha3 armhf -aptitude 0.8.9-1 armhf -aptitude-common 0.8.9-1 all -avahi-daemon 0.7-3 armhf -base-files 10+rpi1 armhf +apt 1.6~beta1 armhf +apt-listchanges 3.16 all +apt-utils 1.6~beta1 armhf +aptitude 0.8.10-6 armhf +aptitude-common 0.8.10-6 all +avahi-daemon 0.7-3.1+b1 armhf +base-files 10.1+rpi1 armhf -bash 4.4-5 armhf -bash-completion 1:2.1-4.3 all -bind9 1:9.10.3.dfsg.P4-12.6 armhf -bind9-host 1:9.10.3.dfsg.P4-12.6 armhf -bind9utils 1:9.10.3.dfsg.P4-12.6 armhf -binutils 2.29.1-6+rpi1 armhf -binutils-arm-linux-gnueabihf 2.29.1-6+rpi1 armhf -binutils-common 2.29.1-6+rpi1 armhf +bash 4.4.18-1.1 armhf +bash-completion 1:2.7-1 all +bind9 1:9.11.2.P1-1 armhf +bind9-host 1:9.11.2.P1-1 armhf +bind9utils 1:9.11.2.P1-1 armhf +binutils 2.30-7+rpi1 armhf +binutils-arm-linux-gnueabihf 2.30-7+rpi1 armhf +binutils-common 2.30-7+rpi1 armhf -bluez 5.47-1 armhf -bluez-firmware 1.2-3+rpi2 all -bridge-utils 1.5-14 armhf +bluez 5.47-1+b3 armhf +bluez-firmware 1.2-3+rpt4.1 all +bridge-utils 1.5-15 armhf -bsdmainutils 9.0.14 armhf -bsdutils 1:2.30.2-0.1 armhf +bsdmainutils 11.1.2 armhf +bsdutils 1:2.31.1-0.4 armhf -certbot 0.19.0-1 all +certbot 0.21.1-1 all -console-setup 1.170 all -console-setup-linux 1.170 all -coreutils 8.26-3 armhf -cpio 2.11+dfsg-6 armhf +console-setup 1.178 all +console-setup-linux 1.178 all +coreutils 8.28-1 armhf +cpio 2.12+dfsg-6 armhf -cpp-6 6.4.0-6 armhf -cpp-7 7.2.0-12 armhf +cpp-6 6.4.0-12+rpi1 armhf +cpp-7 7.3.0-5 armhf -curl 7.56.1-1 armhf -dash 0.5.8-2.5 armhf -dbus 1.12.0-1 armhf -dc 1.06.95-9 armhf -debconf 1.5.64 all -debconf-i18n 1.5.64 all -debconf-utils 1.5.64 all -debianutils 4.8.2 armhf +curl 7.58.0-2 armhf +dash 0.5.8-2.10 armhf +dbus 1.12.6-2 armhf +dc 1.07.1-1 armhf +debconf 1.5.66 all +debconf-i18n 1.5.66 all +debconf-utils 1.5.66 all +debianutils 4.8.4 armhf -dhcpcd5 1:6.11.5-1+rpt2 armhf +dhcpcd5 1:6.11.5-1+rpt4 armhf -dirmngr 2.2.1-5 armhf +dirmngr 2.2.5-1 armhf -dmsetup 2:1.02.142-1 armhf -dnsutils 1:9.10.3.dfsg.P4-12.6 armhf +dmsetup 2:1.02.145-4.1 armhf +dnsutils 1:9.11.2.P1-1 armhf -dpkg 1.19.0.4 armhf -dpkg-dev 1.19.0.4 all -e2fslibs 1.43.7-1 armhf -e2fsprogs 1.43.7-1 armhf -e2fsprogs-l10n 1.43.7-1 all +dpkg 1.19.0.5 armhf +dpkg-dev 1.19.0.5 all +e2fslibs 1.44.0-1 armhf +e2fsprogs 1.44.0-1 armhf +e2fsprogs-l10n 1.44.0-1 all -elinks 0.12~pre6-12+b1 armhf -elinks-data 0.12~pre6-12 all -etckeeper 1.18.5-1 all -exim4-base 4.89-7 armhf -exim4-config 4.89-7 all -exim4-daemon-light 4.89-7 armhf -eyed3 0.8-1 all -fail2ban 0.9.7-2 all +elinks 0.12~pre6-13 armhf +elinks-data 0.12~pre6-13 all +etckeeper 1.18.7-1 all +exim4-base 4.90.1-1 armhf +exim4-config 4.90.1-1 all +exim4-daemon-light 4.90.1-1 armhf +eyed3 0.8.4-2 all +fail2ban 0.10.2-1 all -fakeroot 1.22-1 armhf -fbset 2.1-29 armhf -fdisk 2.30.2-0.1 armhf -file 1:5.32-1 armhf -findutils 4.6.0+git+20170729-2 armhf -firmware-atheros 1:20161130-3+rpi2 all -firmware-brcm80211 1:20161130-3+rpi2 all -firmware-libertas 1:20161130-3+rpi2 all -firmware-misc-nonfree 1:20161130-3+rpi2 all -firmware-realtek 1:20161130-3+rpi2 all -fontconfig-config 2.12.3-0.2 all +fakeroot 1.22-2 armhf +fbset 2.1-30 armhf +fdisk 2.31.1-0.4 armhf +file 1:5.32-2 armhf +findutils 4.6.0+git+20170828-2 armhf +firmware-atheros 1:20161130-3+rpt3 all +firmware-brcm80211 1:20161130-3+rpt3 all +firmware-libertas 1:20161130-3+rpt3 all +firmware-misc-nonfree 1:20161130-3+rpt3 all +firmware-realtek 1:20161130-3+rpt3 all +fontconfig-config 2.12.6-0.1 all -g++-7 7.2.0-12 armhf -gawk 1:4.1.4+dfsg-1 armhf +g++-7 7.3.0-5 armhf +gawk 1:4.1.4+dfsg-1+b1 armhf -gcc-4.9-base 4.9.3-14 armhf -gcc-5-base 5.4.1-4 armhf -gcc-6 6.4.0-6 armhf -gcc-6-base 6.4.0-6 armhf -gcc-7 7.2.0-12 armhf -gcc-7-base 7.2.0-12 armhf -gdb 7.12-6 armhf -geoip-database 20170928-1 all +gcc-4.9-base 4.9.4-2+rpi1 armhf +gcc-5-base 5.5.0-8 armhf +gcc-6 6.4.0-12+rpi1 armhf +gcc-6-base 6.4.0-12+rpi1 armhf +gcc-7 7.3.0-5 armhf +gcc-7-base 7.3.0-5 armhf +gcc-8-base 8-20180218-1+rpi1 armhf +gdb 7.12-6+b1 armhf +geoip-database 20180215-1 all -gir1.2-glib-2.0 1.54.1-2 armhf -git 1:2.14.2-1 armhf -git-man 1:2.14.2-1 all -gnupg 2.2.1-5 armhf -gnupg-agent 2.2.1-5 all -gnupg-l10n 2.2.1-5 all -gnupg-utils 2.2.1-5 armhf -gpg 2.2.1-5 armhf -gpg-agent 2.2.1-5 armhf -gpg-wks-client 2.2.1-5 armhf -gpg-wks-server 2.2.1-5 armhf -gpgconf 2.2.1-5 armhf -gpgsm 2.2.1-5 armhf -gpgv 2.2.1-5 armhf +gir1.2-glib-2.0 1.54.1-4 armhf +git 1:2.16.2-1 armhf +git-man 1:2.16.2-1 all +gnupg 2.2.5-1 armhf +gnupg-agent 2.2.5-1 all +gnupg-l10n 2.2.5-1 all +gnupg-utils 2.2.5-1 armhf +gpg 2.2.5-1 armhf +gpg-agent 2.2.5-1 armhf +gpg-wks-client 2.2.5-1 armhf +gpg-wks-server 2.2.5-1 armhf +gpgconf 2.2.5-1 armhf +gpgsm 2.2.5-1 armhf +gpgv 2.2.5-1 armhf -groff-base 1.22.3-9 armhf +groff-base 1.22.3-10 armhf -hostname 3.18 armhf -htop 2.0.2-1 armhf -i2c-tools 3.1.2-3+b1 armhf -id3tool 1.2a-7 armhf -id3v2 0.1.12-3 armhf -ifupdown 0.8.29 armhf -info 6.5.0.dfsg.1-1 armhf +hostname 3.20 armhf +htop 2.1.0-3 armhf +i2c-tools 4.0-2 armhf +id3tool 1.2a-8 armhf +id3v2 0.1.12+dfsg-1 armhf +ifupdown 0.8.31 armhf +info 6.5.0.dfsg.1-2 armhf -install-info 6.5.0.dfsg.1-1 armhf +install-info 6.5.0.dfsg.1-2 armhf -iproute2 4.9.0-2 armhf -iptables 1.6.1-2+b1 armhf +iproute2 4.15.0-2 armhf +iptables 1.6.2-1 armhf -isc-dhcp-client 4.3.5-3 armhf -isc-dhcp-common 4.3.5-3+b1 armhf -isc-dhcp-server 4.3.5-3 armhf -iso-codes 3.76-1 all -iw 4.9-0.1 armhf +isc-dhcp-client 4.3.5-3.1 armhf +isc-dhcp-common 4.3.5-3.1 armhf +isc-dhcp-server 4.3.5-3.1 armhf +iso-codes 3.79-1 all +iw 4.14-0.1 armhf -keyboard-configuration 1.170 all -keyutils 1.5.9-9 armhf -klibc-utils 2.0.4-9+rpi1 armhf -kmod 24-1 armhf -less 481-2.1 armhf +keyboard-configuration 1.178 all +keyutils 1.5.9-9.2 armhf +klibc-utils 2.0.4-11+rpi1 armhf +kmod 25-1 armhf +less 487-0.1 armhf -libalgorithm-diff-xs-perl 0.04-4+b3 armhf +libalgorithm-diff-xs-perl 0.04-5 armhf -libapparmor1 2.11.1-2 armhf -libapt-inst2.0 1.6~alpha3 armhf -libapt-pkg5.0 1.6~alpha3 armhf -libasan3 6.4.0-6 armhf -libasan4 7.2.0-12 armhf +libapparmor1 2.12-3 armhf +libapt-inst2.0 1.6~beta1 armhf +libapt-pkg5.0 1.6~beta1 armhf +libargon2-0 0~20161029-1.1 armhf +libasan3 6.4.0-12+rpi1 armhf +libasan4 7.3.0-5 armhf -libassuan0 2.4.3-3 armhf -libatomic1 7.2.0-12 armhf +libassuan0 2.5.1-2 armhf +libatomic1 8-20180218-1+rpi1 armhf -libaudit-common 1:2.8.1-1 all -libaudit1 1:2.8.1-1 armhf +libaudit-common 1:2.8.2-1 all +libaudit1 1:2.8.2-1 armhf -libavahi-common-data 0.7-3 armhf -libavahi-common3 0.7-3 armhf -libavahi-core7 0.7-3 armhf -libbabeltrace-ctf1 1.5.3-4 all -libbabeltrace1 1.5.3-4 armhf +libavahi-common-data 0.7-3.1+b1 armhf +libavahi-common3 0.7-3.1+b1 armhf +libavahi-core7 0.7-3.1+b1 armhf +libbabeltrace-ctf1 1.5.4-1 all +libbabeltrace1 1.5.4-1 armhf -libbinutils 2.29.1-6+rpi1 armhf +libbind9-160 1:9.11.2.P1-1 armhf +libbinutils 2.30-7+rpi1 armhf -libblkid1 2.30.2-0.1 armhf -libboost-filesystem1.62.0 1.62.0+dfsg-4+b2 armhf +libblkid1 2.31.1-0.4 armhf +libboost-filesystem1.62.0 1.62.0+dfsg-5 armhf -libboost-iostreams1.62.0 1.62.0+dfsg-4+b2 armhf -libboost-system1.62.0 1.62.0+dfsg-4+b2 armhf -libbsd0 0.8.6-2 armhf +libboost-iostreams1.62.0 1.62.0+dfsg-5 armhf +libboost-system1.62.0 1.62.0+dfsg-5 armhf +libbsd0 0.8.7-1 armhf -libc-bin 2.24-17 armhf -libc-dev-bin 2.24-17 armhf -libc-l10n 2.24-17 all -libc6 2.24-17 armhf -libc6-dbg 2.24-17 armhf -libc6-dev 2.24-17 armhf +libc-bin 2.27-1+rpi1 armhf +libc-dev-bin 2.27-1+rpi1 armhf +libc-l10n 2.27-1+rpi1 all +libc6 2.27-1+rpi1 armhf +libc6-dbg 2.27-1+rpi1 armhf +libc6-dev 2.27-1+rpi1 armhf -libcap2 1:2.25-1.1 armhf -libcap2-bin 1:2.25-1.1 armhf -libcc1-0 7.2.0-12 armhf -libcilkrts5 7.2.0-12 armhf -libcomerr2 1.43.7-1 armhf +libcap2 1:2.25-1.2 armhf +libcap2-bin 1:2.25-1.2 armhf +libcc1-0 8-20180218-1+rpi1 armhf +libcilkrts5 7.3.0-5 armhf +libcom-err2 1.44.0-1 armhf +libcomerr2 1.44.0-1 armhf +libcryptsetup12 2:2.0.1-1 armhf -libcurl3 7.56.1-1 armhf -libcurl3-gnutls 7.56.1-1 armhf -libcwidget3v5 0.5.17-6 armhf +libcurl3 7.58.0-2 armhf +libcurl3-gnutls 7.58.0-2 armhf +libcwidget3v5 0.5.17-7 armhf -libdbus-1-3 1.12.0-1 armhf -libdbus-glib-1-2 0.108-2 armhf -libdebconfclient0 0.232 armhf -libdevmapper1.02.1 2:1.02.142-1 armhf +libdbus-1-3 1.12.6-2 armhf +libdbus-glib-1-2 0.110-2 armhf +libdebconfclient0 0.241 armhf +libdevmapper1.02.1 2:1.02.145-4.1 armhf +libdns-export169 1:9.11.2.P1-1 armhf -libdpkg-perl 1.19.0.4 all -libdrm-common 2.4.85-1+rpi1 all -libdrm2 2.4.85-1+rpi1 armhf -libdw1 0.170-0.1 armhf +libdns169 1:9.11.2.P1-1 armhf +libdpkg-perl 1.19.0.5 all +libdrm-common 2.4.90-1+rpi1 all +libdrm2 2.4.90-1+rpi1 armhf +libdw1 0.170-0.3 armhf -libelf1 0.170-0.1 armhf +libelf1 0.170-0.3 armhf -libexpat1 2.2.3-1 armhf -libexpat1-dev 2.2.3-1 armhf -libfakeroot 1.22-1 armhf -libfastjson4 0.99.7-1 armhf -libfdisk1 2.30.2-0.1 armhf -libffi6 3.2.1-6 armhf -libfftw3-single3 3.3.6p2-2 armhf +libexpat1 2.2.5-3 armhf +libexpat1-dev 2.2.5-3 armhf +libext2fs2 1.44.0-1 armhf +libfakeroot 1.22-2 armhf +libfastjson4 0.99.8-2 armhf +libfdisk1 2.31.1-0.4 armhf +libffi6 3.2.1-8 armhf +libfftw3-single3 3.3.7-1 armhf -libfontconfig1 2.12.3-0.2 armhf -libfreetype6 2.8.1-0.1 armhf -libfreetype6-dev 2.8.1-0.1 armhf +libfontconfig1 2.12.6-0.1 armhf +libfreetype6 2.8.1-2 armhf +libfreetype6-dev 2.8.1-2 armhf -libgcc-6-dev 6.4.0-6 armhf -libgcc-7-dev 7.2.0-12 armhf -libgcc1 1:7.2.0-12 armhf -libgcrypt20 1.7.9-1 armhf +libgcc-6-dev 6.4.0-12+rpi1 armhf +libgcc-7-dev 7.3.0-5 armhf +libgcc1 1:8-20180218-1+rpi1 armhf +libgcrypt20 1.8.1-4 armhf +libgdbm-compat4 1.14.1-4 armhf -libgeoip1 1.6.11-2 armhf -libgfortran4 7.2.0-12 armhf -libgirepository-1.0-1 1.54.1-2 armhf -libglib2.0-0 2.54.1-1 armhf -libglib2.0-data 2.54.1-1 all -libgmp10 2:6.1.2+dfsg-1.1 armhf -libgnutls30 3.5.16-1 armhf -libgomp1 7.2.0-12 armhf -libgpg-error0 1.27-4 armhf -libgpm2 1.20.4-6.2 armhf -libgssapi-krb5-2 1.15.2-2 armhf -libhogweed4 3.3-2 armhf +libgdbm5 1.14.1-4 armhf +libgeoip1 1.6.12-1 armhf +libgfortran4 7.3.0-5 armhf +libgirepository-1.0-1 1.54.1-4 armhf +libglib2.0-0 2.54.3-2 armhf +libglib2.0-data 2.54.3-2 all +libgmp10 2:6.1.2+dfsg-3 armhf +libgnutls30 3.5.18-1 armhf +libgomp1 8-20180218-1+rpi1 armhf +libgpg-error0 1.27-6 armhf +libgpm2 1.20.7-5 armhf +libgssapi-krb5-2 1.16-2 armhf +libhogweed4 3.4-1 armhf -libhtml-tree-perl 5.03-2 all -libhttp-cookies-perl 6.01-1 all +libhtml-tree-perl 5.07-1 all +libhttp-cookies-perl 6.04-1 all -libhttp-message-perl 6.13-1 all +libhttp-message-perl 6.14-1 all +libi2c0 4.0-2 armhf -libidn11 1.33-2 armhf -libidn2-0 2.0.2-5 armhf +libidn11 1.33-2.1 armhf +libidn2-0 2.0.4-1.1 armhf -libio-socket-ssl-perl 2.052-1 all -libip4tc0 1.6.1-2+b1 armhf -libip6tc0 1.6.1-2+b1 armhf -libiptc0 1.6.1-2+b1 armhf +libio-socket-ssl-perl 2.056-1 all +libip4tc0 1.6.2-1 armhf +libip6tc0 1.6.2-1 armhf +libiptc0 1.6.2-1 armhf +libirs-export160 1:9.11.2.P1-1 armhf +libirs160 1:9.11.2.P1-1 armhf +libisc-export166 1:9.11.2.P1-1 armhf +libisc166 1:9.11.2.P1-1 armhf +libisccc160 1:9.11.2.P1-1 armhf +libisccfg-export160 1:9.11.2.P1-1 armhf +libisccfg160 1:9.11.2.P1-1 armhf -libjim0.77 0.77-2 armhf -libjpeg62-turbo 1:1.5.2-2 armhf +libjim0.77 0.77+dfsg0-2 armhf +libjpeg62-turbo 1:1.5.2-2+b1 armhf -libjs-sphinxdoc 1.6.5-2 all +libjs-sphinxdoc 1.6.7-1 all -libk5crypto3 1.15.2-2 armhf -libkeyutils1 1.5.9-9 armhf -libklibc 2.0.4-9+rpi1 armhf -libkmod2 24-1 armhf -libkrb5-3 1.15.2-2 armhf -libkrb5support0 1.15.2-2 armhf +libjson-c3 0.12.1-1.3 armhf +libk5crypto3 1.16-2 armhf +libkeyutils1 1.5.9-9.2 armhf +libklibc 2.0.4-11+rpi1 armhf +libkmod2 25-1 armhf +libkrb5-3 1.16-2 armhf +libkrb5support0 1.16-2 armhf +liblmdb0 0.9.21-1 armhf -liblockfile-bin 1.14-1 armhf -liblockfile1 1.14-1 armhf -liblogging-stdlog0 1.0.6-1 armhf +liblockfile-bin 1.14-1.1 armhf +liblockfile1 1.14-1.1 armhf +liblogging-stdlog0 1.0.6-3 armhf +liblwres160 1:9.11.2.P1-1 armhf -libmagic-mgc 1:5.32-1 armhf -libmagic1 1:5.32-1 armhf +libmagic-mgc 1:5.32-2 armhf +libmagic1 1:5.32-2 armhf -libmount1 2.30.2-0.1 armhf -libmpc3 1.0.3-2 armhf +libmount1 2.31.1-0.4 armhf +libmpc3 1.1.0-1 armhf +libmpfr6 4.0.0-7 armhf -libncurses5 6.0+20170902-1 armhf -libncursesw5 6.0+20170902-1 armhf +libncurses5 6.1-1 armhf +libncursesw5 6.1-1 armhf -libnet-ssleay-perl 1.80-1+b1 armhf +libnet-ssleay-perl 1.84-1 armhf -libnettle6 3.3-2 armhf -libnewt0.52 0.52.20-1+b1 armhf +libnettle6 3.4-1 armhf +libnewt0.52 0.52.20-3 armhf -libnghttp2-14 1.27.0-1 armhf -libnginx-mod-http-auth-pam 1.13.6-2 armhf -libnginx-mod-http-dav-ext 1.13.6-2 armhf -libnginx-mod-http-echo 1.13.6-2 armhf -libnginx-mod-http-geoip 1.13.6-2 armhf -libnginx-mod-http-image-filter 1.13.6-2 armhf -libnginx-mod-http-subs-filter 1.13.6-2 armhf -libnginx-mod-http-upstream-fair 1.13.6-2 armhf -libnginx-mod-http-xslt-filter 1.13.6-2 armhf -libnginx-mod-mail 1.13.6-2 armhf -libnginx-mod-stream 1.13.6-2 armhf -libnih-dbus1 1.0.3-8 armhf -libnih1 1.0.3-8 armhf +libnghttp2-14 1.31.0-1 armhf +libnginx-mod-http-auth-pam 1.13.9-1 armhf +libnginx-mod-http-dav-ext 1.13.9-1 armhf +libnginx-mod-http-echo 1.13.9-1 armhf +libnginx-mod-http-geoip 1.13.9-1 armhf +libnginx-mod-http-image-filter 1.13.9-1 armhf +libnginx-mod-http-subs-filter 1.13.9-1 armhf +libnginx-mod-http-upstream-fair 1.13.9-1 armhf +libnginx-mod-http-xslt-filter 1.13.9-1 armhf +libnginx-mod-mail 1.13.9-1 armhf +libnginx-mod-stream 1.13.9-1 armhf +libnih-dbus1 1.0.3-10+b9 armhf +libnih1 1.0.3-10+b9 armhf -libnpth0 1.5-2 armhf +libnpth0 1.5-3 armhf +libnss-systemd 237-3+b1 armhf -libpam-modules 1.1.8-3.6+rpi1 armhf -libpam-modules-bin 1.1.8-3.6+rpi1 armhf -libpam-runtime 1.1.8-3.6+rpi1 all -libpam-systemd 235-2 armhf -libpam0g 1.1.8-3.6+rpi1 armhf -libparted2 3.2-18 armhf -libpcap0.8 1.8.1-5 armhf -libpcre2-8-0 10.22-3 armhf -libpcre3 2:8.39-4 armhf -libpcsclite1 1.8.22-1 armhf -libperl5.26 5.26.1-2 armhf -libpipeline1 1.4.2-1 armhf -libplymouth4 0.9.3-1 armhf +libpam-modules 1.1.8-3.7 armhf +libpam-modules-bin 1.1.8-3.7 armhf +libpam-runtime 1.1.8-3.7 all +libpam-systemd 237-3+b1 armhf +libpam0g 1.1.8-3.7 armhf +libparted2 3.2-20 armhf +libpcap0.8 1.8.1-6 armhf +libpcre2-8-0 10.31-3 armhf +libpcre3 2:8.39-9 armhf +libpcsclite1 1.8.23-1 armhf +libperl5.26 5.26.1-5 armhf +libpipeline1 1.5.0-1 armhf +libplymouth4 0.9.3-2 armhf -libprocps6 2:3.3.12-3 armhf -libpsl5 0.18.0-4 armhf -libpython-stdlib 2.7.14-1 armhf -libpython2.7-minimal 2.7.14-2 armhf -libpython2.7-stdlib 2.7.14-2 armhf -libpython3-dev 3.6.3-2 armhf -libpython3-stdlib 3.6.3-2 armhf +libprocps6 2:3.3.12-4 armhf +libpsl5 0.19.1-5 armhf +libpython-stdlib 2.7.14-4 armhf +libpython2.7-minimal 2.7.14-6 armhf +libpython2.7-stdlib 2.7.14-6 armhf +libpython3-dev 3.6.4-1 armhf +libpython3-stdlib 3.6.4-1 armhf -libpython3.6 3.6.3-1 armhf -libpython3.6-dev 3.6.3-1 armhf -libpython3.6-minimal 3.6.3-1 armhf -libpython3.6-stdlib 3.6.3-1 armhf -libraspberrypi-bin 1.20170811-1 armhf -libraspberrypi-dev 1.20170811-1 armhf -libraspberrypi-doc 1.20170811-1 armhf -libraspberrypi0 1.20170811-1 armhf +libpython3.6 3.6.4-4 armhf +libpython3.6-dev 3.6.4-4 armhf +libpython3.6-minimal 3.6.4-4 armhf +libpython3.6-stdlib 3.6.4-4 armhf +libraspberrypi-bin 1.20180313-1 armhf +libraspberrypi-dev 1.20180313-1 armhf +libraspberrypi-doc 1.20180313-1 armhf +libraspberrypi0 1.20180313-1 armhf -libruby2.3 2.3.3-1+deb9u1+rpi1 armhf -libsamplerate0 0.1.9-1 armhf +libruby2.3 2.3.6-2+rpi1 armhf +libruby2.5 2.5.0-6+rpi1 armhf +libsamplerate0 0.1.9-2 armhf -libsigsegv2 2.11-1 armhf -libslang2 2.3.1a-1 armhf -libsmartcols1 2.30.2-0.1 armhf -libsqlite3-0 3.20.1-2 armhf -libss2 1.43.7-1 armhf +libsigsegv2 2.12-1 armhf +libslang2 2.3.2-1 armhf +libsmartcols1 2.31.1-0.4 armhf +libsqlite3-0 3.22.0-1 armhf +libss2 1.44.0-1 armhf -libssl1.0.2 1.0.2l-2 armhf +libssl1.0.2 1.0.2n-1 armhf -libstdc++-7-dev 7.2.0-12 armhf -libstdc++6 7.2.0-12 armhf +libstdc++-7-dev 7.3.0-5 armhf +libstdc++6 8-20180218-1+rpi1 armhf -libsystemd0 235-2 armhf +libsystemd0 237-3+b1 armhf -libtasn1-6 4.12-2.1 armhf -libtcl8.6 8.6.7+dfsg-1 armhf +libtasn1-6 4.13-2 armhf +libtcl8.6 8.6.8+dfsg-3 armhf -libtiff5 4.0.8-6 armhf +libtiff5 4.0.9-4 armhf -libtinfo5 6.0+20170902-1 armhf +libtinfo5 6.1-1 armhf -libtry-tiny-perl 0.28-1 all -libubsan0 7.2.0-12 armhf +libtry-tiny-perl 0.30-1 all +libubsan0 7.3.0-5 armhf -libudev1 235-2 armhf +libudev1 237-3+b1 armhf -libunistring2 0.9.7-2 armhf -liburi-perl 1.72-2 all +libunistring2 0.9.8-1 armhf +liburi-perl 1.73-1 all -libuuid1 2.30.2-0.1 armhf -libv4l-0 1.12.5-1 armhf -libv4l2rds0 1.12.5-1 armhf -libv4lconvert0 1.12.5-1 armhf -libwbclient0 2:4.7.0+dfsg-2 armhf -libwebp6 0.6.0-3 armhf +libuuid1 2.31.1-0.4 armhf +libv4l-0 1.14.2-1 armhf +libv4l2rds0 1.14.2-1 armhf +libv4lconvert0 1.14.2-1 armhf +libwbclient0 2:4.7.4+dfsg-2 armhf +libwebp6 0.6.1-2 armhf -libwww-perl 6.27-1 all +libwww-perl 6.31-1 all -libxcb1 1.12-1 armhf +libxcb1 1.13-1 armhf -libxml2 2.9.4+dfsg1-5 armhf +libxml2 2.9.4+dfsg1-6.1 armhf -libxslt1.1 1.1.29-2.2 armhf -libxtables12 1.6.1-2+b1 armhf +libxslt1.1 1.1.29-5 armhf +libxtables12 1.6.2-1 armhf -linux-libc-dev 4.9.51-1+rpi3+b1 armhf -locales 2.24-17 all +linux-libc-dev 4.15.4-1+rpi1 armhf +locales 2.27-1+rpi1 all -man-db 2.7.6.1-2 armhf -manpages 4.13-3 all -manpages-dev 4.13-3 all +man-db 2.8.2-1 armhf +manpages 4.15-1 all +manpages-dev 4.15-1 all -mount 2.30.2-0.1 armhf +mount 2.31.1-0.4 armhf -multiarch-support 2.24-17 armhf +multiarch-support 2.27-1+rpi1 armhf -nano 2.8.7-1 armhf +nano 2.9.3-2 armhf -ncurses-base 6.0+20170902-1 all -ncurses-bin 6.0+20170902-1 armhf -ncurses-term 6.0+20170902-1 all +ncurses-base 6.1-1 all +ncurses-bin 6.1-1 armhf +ncurses-term 6.1-1 all -net-tools 1.60+git20161116.90da8a0-1 armhf +net-tools 1.60+git20161116.90da8a0-2 armhf -netcat-openbsd 1.178-3 armhf +netcat-openbsd 1.187-1 armhf -nfs-common 1:1.3.4-2.1+b1 armhf -nginx 1.13.6-2 all -nginx-common 1.13.6-2 all -nginx-full 1.13.6-2 armhf +nfs-common 1:1.3.4-2.2 armhf +nginx-common 1.13.9-1 all -openssh-client 1:7.6p1-2 armhf -openssh-server 1:7.6p1-2 armhf -openssh-sftp-server 1:7.6p1-2 armhf +openssh-client 1:7.6p1-4 armhf +openssh-server 1:7.6p1-4 armhf +openssh-sftp-server 1:7.6p1-4 armhf -parted 3.2-18 armhf +parted 3.2-20 armhf -patch 2.7.5-1 armhf +patch 2.7.6-1 armhf -perl 5.26.1-2 armhf -perl-base 5.26.1-2 armhf -perl-modules-5.26 5.26.1-2 all +perl 5.26.1-5 armhf +perl-base 5.26.1-5 armhf +perl-modules-5.26 5.26.1-5 all -pi-bluetooth 0.1.6 armhf -pinentry-curses 1.0.0-3 armhf +pi-bluetooth 0.1.7 all +pinentry-curses 1.1.0-1 armhf -plymouth 0.9.3-1 armhf +plymouth 0.9.3-2 armhf -procps 2:3.3.12-3 armhf +procps 2:3.3.12-4 armhf -python 2.7.14-1 armhf -python-acme 0.19.0-1 all +python 2.7.14-4 armhf +python-acme 0.21.1-1 all -python-asn1crypto 0.22.0-1 all +python-asn1crypto 0.24.0-1 all -python-certbot 0.19.0-1 all -python-certifi 2017.7.27.1-2 all -python-cffi-backend 1.9.1-2+b1 armhf +python-certifi 2018.1.18-2 all +python-cffi-backend 1.11.5-1 armhf -python-cryptography 1.9-1 armhf -python-enum34 1.1.6-1 all -python-eyed3 0.8-1 all -python-funcsigs 1.0.2-3 all +python-cryptography 2.1.4-1 armhf +python-enum34 1.1.6-2 all +python-eyed3 0.8.4-2 all +python-funcsigs 1.0.2-4 all -python-idna 2.5-1 all +python-idna 2.6-1 all +python-josepy 1.0.1-1 all -python-minimal 2.7.14-1 armhf +python-magic 2:0.4.15-1 all +python-minimal 2.7.14-4 armhf -python-newt 0.52.20-1+b1 armhf -python-openssl 16.2.0-1 all +python-newt 0.52.20-3 armhf +python-openssl 17.5.0-1 all -python-pbr 3.1.1-2 all -python-pip-whl 9.0.1-2+rpt1 all -python-pkg-resources 36.6.0-1 all +python-pbr 3.1.1-4 all +python-pip-whl 9.0.1-2+rpt2 all +python-pkg-resources 38.5.2-1 all -python-requests 2.18.1-1 all +python-requests 2.18.4-2 all -python-setuptools 36.6.0-1 all -python-six 1.11.0-1 all -python-tz 2017.2-2 all -python-urllib3 1.21.1-1 all +python-setuptools 38.5.2-1 all +python-six 1.11.0-2 all +python-tz 2018.3-2 all +python-urllib3 1.22-1 all -python2.7 2.7.14-2 armhf -python2.7-minimal 2.7.14-2 armhf -python3 3.6.3-2 armhf +python2.7 2.7.14-6 armhf +python2.7-minimal 2.7.14-6 armhf +python3 3.6.4-1 armhf +python3-acme 0.21.1-1 all -python3-asn1crypto 0.22.0-1 all -python3-cffi-backend 1.9.1-2+b1 armhf -python3-crypto 2.6.1-7+b1 armhf -python3-cryptography 1.9-1 armhf -python3-dbus 1.2.4-1+b1 armhf -python3-debconf 1.5.64 all -python3-dev 3.6.3-2 armhf -python3-gi 3.24.1-3+rpi1 armhf -python3-idna 2.5-1 all -python3-keyring 10.4.0-1 all -python3-keyrings.alt 2.2-2 all -python3-minimal 3.6.3-2 armhf -python3-pip 9.0.1-2+rpt1 all -python3-pkg-resources 36.6.0-1 all +python3-asn1crypto 0.24.0-1 all +python3-certbot 0.21.1-1 all +python3-certifi 2018.1.18-2 all +python3-cffi-backend 1.11.5-1 armhf +python3-chardet 3.0.4-1 all +python3-configargparse 0.11.0-1 all +python3-configobj 5.0.6-2 all +python3-crypto 2.6.1-8 armhf +python3-cryptography 2.1.4-1 armhf +python3-dbus 1.2.6-1 armhf +python3-debconf 1.5.66 all +python3-dev 3.6.4-1 armhf +python3-distutils 3.6.4-4 all +python3-eyed3 0.8.4-2 all +python3-future 0.15.2-4 all +python3-gi 3.26.1-2 armhf +python3-idna 2.6-1 all +python3-josepy 1.0.1-1 all +python3-keyring 10.6.0-1 all +python3-keyrings.alt 3.0-1 all +python3-lib2to3 3.6.4-4 all +python3-magic 2:0.4.15-1 all +python3-minimal 3.6.4-1 armhf +python3-mock 2.0.0-3 all +python3-openssl 17.5.0-1 all +python3-parsedatetime 2.4-2 all +python3-pbr 3.1.1-4 all +python3-pip 9.0.1-2+rpt2 all +python3-pkg-resources 38.5.2-1 all +python3-requests 2.18.4-2 all +python3-rfc3339 1.0-4 all -python3-setuptools 36.6.0-1 all -python3-six 1.11.0-1 all +python3-setuptools 38.5.2-1 all +python3-six 1.11.0-2 all -python3-wheel 0.29.0-2 all +python3-tz 2018.3-2 all +python3-urllib3 1.22-1 all +python3-wheel 0.30.0-0.2 all +python3-zope.component 4.3.0-1 all +python3-zope.event 4.2.0-1 all +python3-zope.hookable 4.0.4-4+b2 armhf +python3-zope.interface 4.3.2-1+b1 armhf -python3.6 3.6.3-1 armhf -python3.6-dev 3.6.3-1 armhf -python3.6-minimal 3.6.3-1 armhf -rake 12.0.0-1 all -raspberrypi-bootloader 1.20170811-1 armhf -raspberrypi-kernel 1.20170811-1 armhf +python3.6 3.6.4-4 armhf +python3.6-dev 3.6.4-4 armhf +python3.6-minimal 3.6.4-4 armhf +rake 12.3.0-1 all +raspberrypi-bootloader 1.20180313-1 armhf +raspberrypi-kernel 1.20180313-1 armhf -raspberrypi-sys-mods 20170717 armhf +raspberrypi-sys-mods 20180315 armhf -raspi-config 20170926 all +raspi-config 20180228 all +rfkill 2.31.1-0.4 armhf -rsync 3.1.2-2 armhf -rsyslog 8.29.0-2 armhf -ruby 1:2.3.3 armhf +rsync 3.1.2-2.1 armhf +rsyslog 8.33.1-1 armhf +ruby 1:2.5.0 armhf -ruby2.3 2.3.3-1+deb9u1+rpi1 armhf +ruby2.3 2.3.6-2+rpi1 armhf +ruby2.5 2.5.0-6+rpi1 armhf -samba-common 2:4.7.0+dfsg-2 all +samba-common 2:4.7.4+dfsg-2 all -sed 4.4-1 armhf +sed 4.4-2 armhf -sensible-utils 0.0.10 all +sensible-utils 0.0.11 all -ssh 1:7.6p1-2 all -strace 4.19-1 armhf -sudo 1.8.21p2-2 armhf -systemd 235-2 armhf -systemd-sysv 235-2 armhf +ssh 1:7.6p1-4 all +strace 4.21-1 armhf +sudo 1.8.21p2-3 armhf +systemd 237-3+b1 armhf +systemd-sysv 237-3+b1 armhf -tasksel 3.42 all -tasksel-data 3.42 all +tasksel 3.43 all +tasksel-data 3.43 all -tmux 2.6-1 armhf +tmux 2.6-3 armhf -tzdata 2017c-1 all -ucf 3.0036 all -udev 235-2 armhf +tzdata 2018c-1 all +ucf 3.0038 all +udev 237-3+b1 armhf -usb-modeswitch 2.5.1+repack0-1+b1 armhf -usb-modeswitch-data 20170806-1 all +usb-modeswitch 2.5.2+repack0-2 armhf +usb-modeswitch-data 20170806-2 all -util-linux 2.30.2-0.1 armhf -v4l-utils 1.12.5-1 armhf +util-linux 2.31.1-0.4 armhf +v4l-utils 1.14.2-1 armhf -vim-common 2:8.0.1144-1 all -vim-nox 2:8.0.1144-1 armhf -vim-runtime 2:8.0.1144-1 all -vim-tiny 2:8.0.1144-1 armhf -vnstat 1.15-2 armhf -wget 1.19.2-1 armhf -whiptail 0.52.20-1+b1 armhf -whois 5.2.18 armhf +vim-common 2:8.0.1453-1 all +vim-nox 2:8.0.1453-1 armhf +vim-runtime 2:8.0.1453-1 all +vim-tiny 2:8.0.1453-1 armhf +vnstat 1.17-1 armhf +wget 1.19.4-1 armhf +whiptail 0.52.20-3 armhf +whois 5.3.0 armhf -wpasupplicant 2:2.4-1.1 armhf -xauth 1:1.0.9-1 armhf -xdg-user-dirs 0.15-3 armhf -xkb-data 2.19-1.1 all +wpasupplicant 2:2.6-15 armhf +xauth 1:1.0.10-1 armhf +xdg-user-dirs 0.16-1 armhf +xkb-data 2.23.1-1 all -xxd 2:8.0.1144-1 armhf +xxd 2:8.0.1453-1 armhf -zsh 5.4.2-1 armhf -zsh-common 5.4.2-1 all +zsh 5.4.2-3 armhf +zsh-common 5.4.2-3 all
7 years ago
PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin
7 years ago
DESC="authentication failure monitor"
NAME=fail2ban
# fail2ban-client is not a daemon itself but starts a daemon and
# loads its with configuration
DAEMON=/usr/bin/$NAME-client
SCRIPTNAME=/etc/init.d/$NAME
# Ad-hoc way to parse out socket file name
SOCKFILE=`grep -h '^[^#]*socket *=' /etc/$NAME/$NAME.conf /etc/$NAME/$NAME.local 2>/dev/null \
| tail -n 1 | sed -e 's/.*socket *= *//g' -e 's/ *$//g'`
[ -z "$SOCKFILE" ] && SOCKFILE='/var/run/fail2ban.sock'
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# Run as root by default.
FAIL2BAN_USER=root
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
DAEMON_ARGS="$FAIL2BAN_OPTS"
# Load the VERBOSE setting and other rcS variables
[ -f /etc/default/rcS ] && . /etc/default/rcS
# Predefine what can be missing from lsb source later on -- necessary to run
# on sarge. Just present it in a bit more compact way from what was shipped
log_daemon_msg () {
[ -z "$1" ] && return 1
echo -n "$1:"
[ -z "$2" ] || echo -n " $2"
}
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
# Actually has to (>=2.0-7) present in sarge. log_daemon_msg is predefined
# so we must be ok
. /lib/lsb/init-functions
#
# Shortcut function for abnormal init script interruption
#
report_bug()
{
echo $*
echo "Please submit a bug report to Debian BTS (reportbug fail2ban)"
exit 1
}
#
# Helper function to check if socket is present, which is often left after
# abnormal exit of fail2ban and needs to be removed
#
check_socket()
{
# Return
# 0 if socket is present and readable
# 1 if socket file is not present
# 2 if socket file is present but not readable
# 3 if socket file is present but is not a socket
[ -e "$SOCKFILE" ] || return 1
[ -r "$SOCKFILE" ] || return 2
[ -S "$SOCKFILE" ] || return 3
return 0
}
#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
do_status && return 1
if [ -e "$SOCKFILE" ]; then
log_failure_msg "Socket file $SOCKFILE is present"
[ "$1" = "force-start" ] \
&& log_success_msg "Starting anyway as requested" \
|| return 2
DAEMON_ARGS="$DAEMON_ARGS -x"
fi
# Assure that /var/run/fail2ban exists
[ -d /var/run/fail2ban ] || mkdir -p /var/run/fail2ban
if [ "$FAIL2BAN_USER" != "root" ]; then
# Make the socket directory, IP lists and fail2ban log
# files writable by fail2ban
chown "$FAIL2BAN_USER" /var/run/fail2ban
# Create the logfile if it doesn't exist
touch /var/log/fail2ban.log
chown "$FAIL2BAN_USER" /var/log/fail2ban.log
find /proc/net/xt_recent -name 'fail2ban-*' -exec chown "$FAIL2BAN_USER" {} \;
fi
start-stop-daemon --start --quiet --chuid "$FAIL2BAN_USER" --exec $DAEMON -- \
$DAEMON_ARGS start > /dev/null\
|| return 2
return 0
}
#
# Function that checks the status of fail2ban and returns
# corresponding code
#
do_status()
{
$DAEMON ping > /dev/null 2>&1
return $?
}
#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
$DAEMON status > /dev/null 2>&1 || return 1
$DAEMON stop > /dev/null || return 2
# now we need actually to wait a bit since it might take time
# for server to react on client's stop request. Especially
# important for restart command on slow boxes
count=1
while do_status && [ $count -lt 60 ]; do
sleep 1
count=$(($count+1))
done
[ $count -lt 60 ] || return 3 # failed to stop
return 0
}
#
# Function to reload configuration
#
do_reload() {
$DAEMON reload > /dev/null && return 0 || return 1
return 0
}
# yoh:
# shortcut function to don't duplicate case statements and to don't use
# bashisms (arrays). Fixes #368218
#
log_end_msg_wrapper()
{
if [ "$3" != "no" ]; then
[ $1 -lt $2 ] && value=0 || value=1
log_end_msg $value
fi
}
command="$1"
case "$command" in
start|force-start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
do_start "$command"
log_end_msg_wrapper $? 2 "$VERBOSE"
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
log_end_msg_wrapper $? 2 "$VERBOSE"
;;
restart|force-reload)
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
log_end_msg_wrapper $? 1 "always"
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
reload|force-reload)
log_daemon_msg "Reloading $DESC" "$NAME"
do_reload
log_end_msg $?
;;
status)
log_daemon_msg "Status of $DESC"
do_status
case $? in
0) log_success_msg " $NAME is running" ;;
255)
check_socket
case $? in
1) log_failure_msg " $NAME is not running" && exit 3 ;;
0) log_failure_msg " $NAME is not running but $SOCKFILE exists" && exit 3 ;;
2) log_failure_msg " $SOCKFILE not readable, status of $NAME is unknown" && exit 3 ;;
3) log_failure_msg " $SOCKFILE exists but not a socket, status of $NAME is unknown" && exit 3 ;;
*) report_bug "Unknown return code from $NAME:check_socket." && exit 4 ;;
esac
;;
*) report_bug "Unknown $NAME status code" && exit 4
esac
;;
*)
echo "Usage: $SCRIPTNAME {start|force-start|stop|restart|force-reload|status}" >&2
exit 3
;;
esac
: