Commit Graph

117 Commits (68f827e1f3945b735f214e15b224a926bb4bf170)

Author SHA1 Message Date
Sergey G. Brester d5a5efcd5a
amend to #2174 for fail2ban.service, fix legacy path, closes gh-2474 2019-07-17 13:38:42 +02:00
Sergey G. Brester 0e5ce68d4c
Merge pull request #2348 from szepeviktor/deb-initd-retry
Safer, nicer, uniform Debian initd script - into 0.10
2019-03-27 14:00:40 +01:00
Eli Schwartz ebf2f28294 tmpfiles.d: don't use legacy directory path
systemd 239 (released June 22) introduces a new warning for tmpfiles.d
snippets touching paths in /var/run instead of the canonical /run

See a2d1fb882c

Update to use the preferred path.
2019-03-13 13:34:16 +01:00
Viktor Szépe 824afbf52d Fix whitespaces 2019-02-17 09:12:30 +00:00
Viktor Szépe 24b0e048d1 Normalizing quote usage in initd 2019-02-17 09:08:59 +00:00
Yaroslav Halchenko 62f957973d ENH: disable shell check for $DAEMON_ARGS expansion 2019-02-17 09:08:32 +00:00
Viktor Szépe dfd2a2063d Safer, nicer, uniform Debian initd script 2019-02-17 09:08:29 +00:00
Sergey G. Brester 67247999ff
closes #2313: missing dependency to nftables.service 2019-01-06 17:03:09 +01:00
Yaroslav Halchenko ae359f6f05 BF: $value not $code 2018-07-24 14:29:43 -04:00
Yaroslav Halchenko 298f2c066a BF: account that now code 255 is the one to say "it is Ok, we are already running/stopped" 2018-07-24 13:24:29 -04:00
Yaroslav Halchenko f323eceec7 BF: debian-initd, exit with exit code in logend_msg_wrapper
and do it unconditionally on the verbosity level
2018-07-24 13:24:29 -04:00
sebres f31195a4fc added new logtarget "SYSOUT" to log from fail2ban working in foreground as systemd-service (in opposite to "STDOUT" don't log time-stamps). 2017-11-26 23:03:29 +01:00
sebres 7e756da2b9 Merge remote-tracking branch 'remotes/gh-upstream/master' into 0.10 2017-11-06 18:56:31 +01:00
Stuart Cardall 18d2761dc0 gentoo-initd: add descriptions
add descriptions to stop syslog errors for extra_started_commands when running:

rc-service ipset describe

Oct 28 15:13:30 xxxx daemon.warn /etc/init.d/fail2ban[26446]: ^[[1m^[[36mreload^[[m: no description
Oct 28 15:13:30 xxxx daemon.warn /etc/init.d/fail2ban[26447]: ^[[1m^[[36mshowlog^[[m: no description
2017-11-01 22:19:14 +01:00
martin61 5db497017a add ip6tables.service ipset.service in systemd unit 2017-10-19 16:44:18 +02:00
Louis Sautier 2ce0ffb977
Fix Gentoo init script's shebang
Use openrc-run instead of runscript.
5d5856c193
2017-09-11 12:19:33 +02:00
sebres e3b061e94b - `files/fail2ban.service` renamed as template to `files/fail2ban.service.in`;
- setup process generates `build/fail2ban.service` from `files/fail2ban.service.in` using distribution related bin-path;
- bug-fixing by running setup with option `--dry-run` (note: specify option `--dry-run` before `install`, like `python setup.py --dry-run install`);
- test cases extended to cover dry-run.
2017-08-23 13:01:29 +02:00
sebres 1a562bed0f Merge remote-tracking branch 'master' into 0.10
# Conflicts:
#	config/filter.d/asterisk.conf
2017-07-19 08:57:23 +02:00
Serg G. Brester 99b668a3cc Merge pull request #1390 from khumarahn/xxx
ensure /var/run/fail2ban is created in systemd service file
2017-07-11 15:53:42 +02:00
oliverdorn 4a65e069e1 Solution for issue #1665
Solves the issue of authentic GoogleBots being banned by apache-fakegooglebots.
2017-01-13 08:59:45 +01:00
Hank Leininger 9fbf713d7d
Wait up to 30 seconds on "stop" to avoid errors.
The fail2ban server can take several seconds to shut down.  This can
make Gentoo's start-stop-service time out and decide that stopping has
failed, even if it actually succeeds a few seconds later.

The default timeout for start-stop-service if --retry is not specified
appears to be 5 seconds.  Increase that to 30 seconds to be sure that if
fail2ban-server is going to be able to stop, it has time to do so.
2016-12-28 11:14:32 -05:00
sebres 45174c5eaf if fail2ban running as systemd-service, for logging to the systemd-journal, the `logtarget` could be set to STDOUT
small fixes by logging in stdout (+ system targets also allowed in lowercase now)
2016-11-24 12:13:47 +01:00
sebres 1cd67ecaa2 automatically creates /var/run/fail2ban before start fail2ban (systems which /var/run/ is virtual resp. memory mount device) 2016-11-24 11:37:18 +01:00
sebres 528a7a5abb systemd service update:
- starting service in normal mode (without forking)
- does not restart if service exited normally (exit-code 0, e.g. stopped via fail2ban-client)
- does not restart if service can not start (exit-code 255, e.g. wrong configuration, etc.)
- service can be additionally started/stopped with commands (fail2ban-client, fail2ban-server)
2016-11-22 11:14:27 +01:00
Viktor Szépe a406c6eb3a By the author:
> Yes, scripting is not supported in path.

https://bitbucket.org/tildeslash/monit/issues/372/webadmin-shows-only-the-first-part-of#comment-27946048
2016-09-22 20:29:26 +00:00
sebres 932708de9e fixed --pidfile bug, introduced in gh-1322:
gentoo-initd fixed --pidfile bug: `--pidfile` is option of start-stop-daemon, not argument of fail2ban (see gh-1434)
closes gh-1434
2016-05-20 11:01:00 +02:00
Alexey Korepanov 5773eb71b8 ensure /var/run/fail2ban is created in systemd service file 2016-04-12 21:20:19 +01:00
Jack Suter fb779a78c5 gentoo-initd: Use start-stop-daemon in order to handle crashes better
Currently, if fail2ban is killed (or crashes), its status will be
reported by '/etc/init.d/fail2ban status' as 'running' even though it
is not. Attempting to restart the service also fails, because Gentoo
unsuccessfully tries to stop the service.

By using start-stop-daemon and providing a pidfile, Gentoo will
instead report the status as 'crashed' and allow the service to be
restarted as normal.
2016-02-16 01:46:27 -05:00
Yaroslav Halchenko 3dc57af19c Merge branch 'logrotate' of https://github.com/sbraz/fail2ban
* 'logrotate' of https://github.com/sbraz/fail2ban:
  Remove compression and count from logrotate
2016-02-10 18:41:01 -05:00
Louis Sautier 869d99dd37
Remove compression and count from logrotate
Initially reported at https://bugs.gentoo.org/show_bug.cgi?id=549856
2016-01-29 00:15:48 +01:00
Louis Sautier 294a7790a9
gentoo-initd: do not hide useful output
Gentoo applies a patch for this: https://bugs.gentoo.org/show_bug.cgi?id=536320
2016-01-28 23:40:36 +01:00
Yaroslav Halchenko 9f15d02910 Merge pull request #1251 from fastest963/master
Added PartOf to service file so f2b restarts when deps do
2015-12-18 09:21:43 -05:00
sarneaud 5b88a84fe8 Small fixes for Gentoo initd script
These fixes are pretty pedantic, but they do simplify the script a
little.

* Checking the existence of a file/directory before creating/deleting
  it adds complexity and raciness.  There are better options.
* mkdir -p does the job of making sure a directory exists.  (It only
  fails if there's a filesystem error or something.)
* Likewise, rm -f doesn't fail if the file doesn't exist.
* rm -r isn't neccessary because the socket shouldn't be a directory.
  (If it is for some reason, that should be an error.)
2015-11-28 15:03:09 +11:00
James Hartig 9905396eb8 Added PartOf to service file so f2b restarts when deps do 2015-11-11 23:10:35 -05:00
Paul Menzel 078e2048f2 files: Strip trailing whitespace from files
Run the command `StripWhitespace` from the [Vim Better Whitespace
Plugin](https://github.com/ntpeters/vim-better-whitespace).
2015-10-08 16:18:08 +02:00
Ville Skyttä 67a94733a9 logrotate: Do not rotate empty logs
As a useful side effect, prevents "Unable to contact server. Is it
running?" mails from cron when fail2ban hasn't been (intentionally)
running nor thus logging anything either.
2015-09-13 11:05:33 +03:00
Ville Skyttä 63c7ceb81d logrotate: Remove outdated Fedora comment 2015-09-13 10:57:51 +03:00
Edward Beckett 03460d5ed0 Update gen_badbots
Added plus char to the regex for escaping user-agent strings.
2015-09-06 01:05:52 -04:00
Yaroslav Halchenko c96415da27 added $named and ufw to debian-initd (Debian bug #776572) 2015-01-29 08:32:20 -05:00
Yaroslav Halchenko d65c4f8f5d moved debian's initd file to files/debian-initd from debian branch 2014-12-30 16:45:35 -05:00
Viktor Szépe 971c3d93fe Monit config
Copy it to `/etc/monit/monitrc.d/fail2ban`
More info: https://github.com/szepeviktor/debian-server-tools/blob/master/monitoring/monit/monit-debian-setup.sh#L113
2014-12-24 14:45:48 +01:00
Yaroslav Halchenko caa851e5c8 RF: moving logwatch setup/sample logs under files/logwatch 2014-09-14 09:48:14 -04:00
Yaroslav Halchenko 2a51a0176a BF: minor type for delignoreregex in bash completions 2014-06-10 03:42:07 -04:00
Cameron Norman 2a14e48f0b A few final touches on the Upstart job
(a) use static-network-up, since it is more generic than the started networking event
(b) do not hook into network deconfiguration to speed up shutdown
(c) expect fork, per the use of the "-f" option
(d) use a variable for the run directory to make changing it simpler
(e) handle the situation of a left over socket file
(f) use the -f option to be able to track the PID
2014-04-22 21:55:51 -07:00
Cameron Norman 39ad5b7474 Update Upstart job: uses stop command in pre-stop, removes PID file in post-stop 2014-04-19 15:10:19 -07:00
Cameron Norman 0ef5027234 Change Upstart job to track PID of the server
This only works correctly if the client does not fork itself when starting the server (which forks twice further).
2014-04-19 14:12:20 -07:00
Cameron Norman 0c8e72f452 Update fail2ban.upstart
No longer directly exec the server, do not remove the PID file because it is unnecessary to do so. No longer respawns because Upstart can not track the process with the starter command.
2014-04-11 17:09:08 -07:00
Cameron Norman 4115b62a01 Update fail2ban.upstart
It was actually a little problematic :)
2014-04-11 16:49:56 -07:00
Cameron Norman 5e3f5db8b7 Create fail2ban.upstart
Add Upstart job.
2014-04-11 08:50:55 -07:00
Ruben Kerkhof ebed0d23c9 Add documentation link to systemd service file
So systemctl help fail2ban.service works

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2014-03-24 14:20:49 +00:00