Systemd service doesn't auto start at boot time

Error message:

Nov 18 09:10:28 pf1 systemd[1]: /etc/systemd/system/crowdsec.service:7: PIDFile= references a path below legacy directory /var/run/, updating /var/run/crowdsec.pid → /run/crowdsec.pid; please update the unit file accordingly.
Nov 18 09:10:28 pf1 systemd[1]: crowdsec.service: Unit cannot be reloaded because it is inactive.
Nov 18 09:10:33 pf1 systemd[1]: /etc/systemd/system/crowdsec.service:7: PIDFile= references a path below legacy directory /var/run/, updating /var/run/crowdsec.pid → /run/crowdsec.pid; please update the unit file accordingly.
Nov 18 09:13:19 pf1 systemd[1]: crowdsec.service: Succeeded.
Nov 18 09:14:01 pf1 systemd[1]: crowdsec.service: Succeeded.
Nov 18 09:14:02 pf1 systemd[1]: crowdsec.service: Main process exited, code=exited, status=1/FAILURE
Nov 18 09:14:02 pf1 systemd[1]: crowdsec.service: Failed with result ‘exit-code’.

Changing line
PIDFile=/var/run/crowdsec.pid
to
PIDFile=/run/crowdsec.pid

Resolved the above error relating to PID file, but still the service doesn’t start at boot time.

OS: Ubuntu 20.04 LTS

2 additional steps to make it auto start at boot time:
sudo chmod +x /etc/systemd/system/crowdsec.service
sudo systemctl enable crowdsec

1 Like

This includes any Blockers, eg:
sudo chmod u+x /etc/systemd/system/netfilter-blocker.service
sudo systemctl enable netfilter-blocker.service

Hello !

Thanks for the feedback, opening an issue to be sure we keep track of this : https://github.com/crowdsecurity/crowdsec/issues/446 !