Joined: 04 Dec 2012
Location: Lago Patria (NA)
|Posted: Tue Dec 04, 2012 1:17 pm Post subject: Systemd and logging issues
|Good afternoon to everybody, guys!
To increase the security of my linux box, I've decided to install Fail2ban to protect the system (and some well-known ports as well) from inappropriate login attempts.
OK, everything works fine, the system sends me an email whenever someone makes a mistake in trying to log on to my machine; the main problem I'm trying to resolve is another, though...
When fail2ban.service is initialized at boot, the email announcing that the service has been initialized is not being created because no Internet connection is available.
On the other hand, when my linux box is being shutdown, no mail is generated because the network service is probably closed...
What I've noticed is that wicd (my network manager) boots 10-15 seconds before fail2ban (and that's ok), then spends 45-60 seconds to boot the network configuration up, while, in the meantime, fail2ban is already up and running, that's why the log email is not being sent.
My question is: is there a way to say to systemd to wait "n" seconds before initializing a service and to stop it before Internet is being arrested?
Thanks in advance for your help...
Andrea from Italy.
Ps: this is the most relevant part of /etc/systemd/system/multi-user.target.wants/fail2ban.service:
Description=Ban IPs that make too many password failures
After=syslog.target network.target wicd.target
"Two things are infinite: the universe and human stupidity; and I'm not sure about the universe" (Albert Einstein)