File: 0003-adjust-systemd-unit.patch

package info (click to toggle)
crowdsec 1.4.6-10.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,500 kB
  • sloc: sh: 2,870; makefile: 386; python: 74
file content (32 lines) | stat: -rw-r--r-- 1,212 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From: Cyril Brulebois <cyril@debamax.com>
Date: Fri, 22 Jan 2021 13:25:54 +0000
Subject: Adjust systemd unit

 - 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.

--- a/config/crowdsec.service
+++ b/config/crowdsec.service
@@ -1,13 +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
-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]