From: Cyril Brulebois Date: Fri, 22 Jan 2021 13:25:54 +0000 (+0000) Subject: Adjust systemd unit X-Git-Tag: archive/raspbian/1.0.9-2+rpi1~1^2~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d14d39a6e800d0f975ec1d68ae7e2b229dbb73d7;p=crowdsec.git Adjust systemd unit - Drop PIDFile (that uses an obsolete path, and doesn't seem to be used at all). - Adjust paths for the packaged crowdsec binary (/usr/bin). - Drop commented out ExecStartPost entirely. - Drop syslog.target dependency, it's socket-activated (thanks to the systemd-service-file-refers-to-obsolete-target lintian tag). - Ensure both local and online API credentials have been defined. Gbp-Pq: Name 0003-adjust-systemd-unit.patch --- diff --git a/config/crowdsec.service b/config/crowdsec.service index 4afa74d..c9d7150 100644 --- a/config/crowdsec.service +++ b/config/crowdsec.service @@ -1,14 +1,15 @@ [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]