[Unit]
Description=Crowdsec agent
-After=syslog.target network.target remote-fs.target nss-lookup.target
+After=network.target remote-fs.target nss-lookup.target
+# Ensure configuration happened:
+ConditionPathExists=/etc/crowdsec/local_api_credentials.yaml
+ConditionPathExists=/etc/crowdsec/online_api_credentials.yaml
[Service]
Type=notify
Environment=LC_ALL=C LANG=C
-PIDFile=/var/run/crowdsec.pid
-ExecStartPre=/usr/local/bin/crowdsec -c /etc/crowdsec/config.yaml -t
-ExecStart=/usr/local/bin/crowdsec -c /etc/crowdsec/config.yaml
-#ExecStartPost=/bin/sleep 0.1
+ExecStartPre=/usr/bin/crowdsec -c /etc/crowdsec/config.yaml -t
+ExecStart=/usr/bin/crowdsec -c /etc/crowdsec/config.yaml
ExecReload=/bin/kill -HUP $MAINPID
[Install]