Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136900465
D29489.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D29489.diff
View Options
Index: security/crowdsec/Makefile
===================================================================
--- security/crowdsec/Makefile
+++ security/crowdsec/Makefile
@@ -2,6 +2,7 @@
PORTNAME= crowdsec
PORTVERSION= 1.0.9
+PORTREVISION= 1
DISTVERSIONPREFIX= v
CATEGORIES= security
Index: security/crowdsec/files/crowdsec.in
===================================================================
--- security/crowdsec/files/crowdsec.in
+++ security/crowdsec/files/crowdsec.in
@@ -1,20 +1,19 @@
#!/bin/sh
-
+#
# $FreeBSD$
#
# PROVIDE: crowdsec
-# REQUIRE: LOGIN DAEMON NETWORKING
+# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# crowdsec_enable (bool): Set it to YES to enable crowdsec agent.
-# Default is "NO".
+# Default is "NO"
# crowdsec_config (str): Set the agent config path.
-# Default is "%%PREFIX%%/etc/crowdsec/config.yaml".
-# crowdsec_flags (str): Set the extra flags to run agent.
-# Default is ""
+# Default is "%%PREFIX%%/etc/crowdsec/config.yaml"
+# crowdsec_flags (str): Set the extra flags to run agent.
. /etc/rc.subr
@@ -24,26 +23,23 @@
load_rc_config $name
-: ${crowdsec_enable:="NO"}
-: ${crowdsec_config:="%%PREFIX%%/etc/crowdsec/config.yaml"}
-: ${crowdsec_flags:=""}
-
-pidfile=/var/run/${name}.pid
-command="%%PREFIX%%/bin/${name}"
-start_cmd="${name}_start"
-configtest_cmd="${name}_configtest"
+: ${crowdsec_enable:=NO}
+: ${crowdsec_config:=%%PREFIX%%/etc/crowdsec/config.yaml}
+
+pidfile=/var/run/$name.pid
+required_files="$crowdsec_config"
+procname="%%PREFIX%%/bin/crowdsec"
+command=/usr/sbin/daemon
+command_args="-fp $pidfile -t '$desc' -- '$procname' -c '$crowdsec_config' $crowdsec_flags"
+start_precmd=crowdsec_configtest
+restart_precmd=crowdsec_configtest
+configtest_cmd=crowdsec_configtest
extra_commands="configtest reload"
-crowdsec_start()
-{
- /usr/sbin/daemon -f -p ${pidfile} -t "${desc}" \
- ${command} -c ${crowdsec_config} ${crowdsec_flags}
-}
-
crowdsec_configtest()
{
echo "Performing sanity check on ${name} configuration."
- eval ${command} -c ${crowdsec_config} -t
+ $procname -c "$crowdsec_config" -t
}
-run_rc_command "$1"
+run_rc_command $1
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 21, 1:17 PM (16 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25766657
Default Alt Text
D29489.diff (2 KB)
Attached To
Mode
D29489: security/crowdsec: rc script improvements
Attached
Detach File
Event Timeline
Log In to Comment