I have a Raspberry Pi where the Raspbian stretch (just updated and upgraded) is set to read-only (https://hallard.me/raspberry-pi-read-only/). I installed fail2ban using apt-get install fail2ban
. The installation went withoug problems, but starting the service fails. Error is the following:
user@raspberrypi(ro):~$ sudo systemctl status fail2ban.service
● fail2ban.service - Fail2Ban Service
Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2018-06-30 22:32:51 CEST; 53s ago
Docs: man:fail2ban(1)
Process: 721 ExecStart=/usr/bin/fail2ban-client -x start (code=exited, status=255)
Jun 30 22:32:51 raspberrypi systemd[1]: fail2ban.service: Control process exited, code=exited status=255
Jun 30 22:32:51 raspberrypi systemd[1]: Failed to start Fail2Ban Service.
Jun 30 22:32:51 raspberrypi systemd[1]: fail2ban.service: Unit entered failed state.
Jun 30 22:32:51 raspberrypi systemd[1]: fail2ban.service: Failed with result 'exit-code'.
Jun 30 22:32:51 raspberrypi systemd[1]: fail2ban.service: Service hold-off time over, scheduling restart.
Jun 30 22:32:51 raspberrypi systemd[1]: Stopped Fail2Ban Service.
Jun 30 22:32:51 raspberrypi systemd[1]: fail2ban.service: Start request repeated too quickly.
Jun 30 22:32:51 raspberrypi systemd[1]: Failed to start Fail2Ban Service.
Jun 30 22:32:51 raspberrypi systemd[1]: fail2ban.service: Unit entered failed state.
Jun 30 22:32:51 raspberrypi systemd[1]: fail2ban.service: Failed with result 'exit-code'.
and
user@raspberrypi(ro):~$ journalctl -xe
-- Unit fail2ban.service has begun starting up.
Jun 30 22:39:46 raspberrypi fail2ban-client[1590]: ERROR There is no directory /var/run/fail2ban to contain the socket file /var/run/fail2ban/fail2ban.sock.
Jun 30 22:39:46 raspberrypi systemd[1]: fail2ban.service: Control process exited, code=exited status=255
Jun 30 22:39:46 raspberrypi systemd[1]: Failed to start Fail2Ban Service.
-- Subject: Unit fail2ban.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit fail2ban.service has failed.
--
-- The result is failed.
Jun 30 22:39:46 raspberrypi systemd[1]: fail2ban.service: Unit entered failed state.
Jun 30 22:39:46 raspberrypi systemd[1]: fail2ban.service: Failed with result 'exit-code'.
Jun 30 22:39:46 raspberrypi systemd[1]: fail2ban.service: Service hold-off time over, scheduling restart.
Jun 30 22:39:46 raspberrypi systemd[1]: Stopped Fail2Ban Service.
-- Subject: Unit fail2ban.service has finished shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit fail2ban.service has finished shutting down.
Jun 30 22:39:46 raspberrypi systemd[1]: Starting Fail2Ban Service...
-- Subject: Unit fail2ban.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit fail2ban.service has begun starting up.
Jun 30 22:39:48 raspberrypi fail2ban-client[1612]: ERROR There is no directory /var/run/fail2ban to contain the socket file /var/run/fail2ban/fail2ban.sock.
Jun 30 22:39:48 raspberrypi systemd[1]: fail2ban.service: Control process exited, code=exited status=255
Jun 30 22:39:48 raspberrypi systemd[1]: Failed to start Fail2Ban Service.
-- Subject: Unit fail2ban.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit fail2ban.service has failed.
--
-- The result is failed.
Jun 30 22:39:48 raspberrypi systemd[1]: fail2ban.service: Unit entered failed state.
Jun 30 22:39:48 raspberrypi systemd[1]: fail2ban.service: Failed with result 'exit-code'.
Jun 30 22:39:48 raspberrypi systemd[1]: fail2ban.service: Service hold-off time over, scheduling restart.
Jun 30 22:39:48 raspberrypi systemd[1]: Stopped Fail2Ban Service.
-- Subject: Unit fail2ban.service has finished shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit fail2ban.service has finished shutting down.
Jun 30 22:39:48 raspberrypi systemd[1]: fail2ban.service: Start request repeated too quickly.
Jun 30 22:39:48 raspberrypi systemd[1]: Failed to start Fail2Ban Service.
-- Subject: Unit fail2ban.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit fail2ban.service has failed.
--
-- The result is failed.
Jun 30 22:39:48 raspberrypi systemd[1]: fail2ban.service: Unit entered failed state.
Jun 30 22:39:48 raspberrypi systemd[1]: fail2ban.service: Failed with result 'exit-code'.
I guess it has something to do that /var/run
is temporary now and is reset with every reboot? If yes, do you guys think there is a way to get around that somehow to get fail2ban running on a read-only fs?
The installation went withoug problems
.... are you sure? – jsotola Jul 1 '18 at 3:54