svn commit: r569135 - in head/security/crowdsec: . files

Chris Rees crees at bayofrum.net
Mon Mar 29 20:02:01 UTC 2021


Hi Sofian,

I've made the suggested changes to your rc script, please review:

https://reviews.FreeBSD.org/D29489

Cheers,

Chris

On 24 March 2021 16:12:04 GMT, Chris Rees <crees at bayofrum.net> wrote:
>Hi Sofian,
>
>Sorry, feel as though I'm piling on here!
>
>On 24 March 2021 15:56:31 GMT, Baptiste Daroussin <bapt at FreeBSD.org>
>wrote:
>>On Wed, Mar 24, 2021 at 03:45:19PM +0000, Sofian Brabez wrote:
>>> Author: sbz
>>> Date: Wed Mar 24 15:45:18 2021
>>> New Revision: 569135
>>> URL: https://svnweb.freebsd.org/changeset/ports/569135
>>> 
>>> Log:
>>>   - Update to 1.0.9
>>>   - Add rc.d script
>>> 
>>> Added:
>>>   head/security/crowdsec/files/
>>>   head/security/crowdsec/files/crowdsec.in   (contents, props
>>changed)
>>> Modified:
>>>   head/security/crowdsec/Makefile
>>>   head/security/crowdsec/distinfo   (contents, props changed)
>>> 
>>> Modified: head/security/crowdsec/Makefile
>>>
>>==============================================================================
>>> --- head/security/crowdsec/Makefile	Wed Mar 24 15:25:44
>>2021	(r569134)
>>> +++ head/security/crowdsec/Makefile	Wed Mar 24 15:45:18
>>2021	(r569135)
>>> @@ -1,7 +1,7 @@
>>>  # $FreeBSD$
>>>  
>>>  PORTNAME=	crowdsec
>>> -PORTVERSION=	1.0.7
>>> +PORTVERSION=	1.0.9
>>>  DISTVERSIONPREFIX=	v
>>>  CATEGORIES=	security
>>>  
>>> @@ -20,6 +20,8 @@ GO_BUILDFLAGS=	-ldflags "-s -w \
>>>  
>>>  GO_TARGET=	./cmd/crowdsec \
>>>  		./cmd/crowdsec-cli
>>> +
>>> +USE_RC_SUBR=	crowdsec
>>>  
>>>  PLIST_FILES=	bin/crowdsec \
>>>  		bin/crowdsec-cli
>>> 
>>> Modified: head/security/crowdsec/distinfo
>>>
>>==============================================================================
>>> --- head/security/crowdsec/distinfo	Wed Mar 24 15:25:44
>>2021	(r569134)
>>> +++ head/security/crowdsec/distinfo	Wed Mar 24 15:45:18
>>2021	(r569135)
>>> @@ -1,5 +1,5 @@
>>> -TIMESTAMP = 1615033328
>>> -SHA256 (go/security_crowdsec/crowdsec-v1.0.7/v1.0.7.mod) =
>>810ca243ce2951dd7ab23d955efc8f50410c94feb8babc47a783146a4c06c798
>>> -SIZE (go/security_crowdsec/crowdsec-v1.0.7/v1.0.7.mod) = 3310
>>> -SHA256 (go/security_crowdsec/crowdsec-v1.0.7/v1.0.7.zip) =
>>1d7f5956826096405b24684db3c924476ffb7fa02f5859af5a6a2c00d8b1d753
>>> -SIZE (go/security_crowdsec/crowdsec-v1.0.7/v1.0.7.zip) = 29305256
>>> +TIMESTAMP = 1616585825
>>> +SHA256 (go/security_crowdsec/crowdsec-v1.0.9/v1.0.9.mod) =
>>b95c6a35287b10ff019c2c3391bad1d0759415cf53cb7c0bfe7b154e479f6531
>>> +SIZE (go/security_crowdsec/crowdsec-v1.0.9/v1.0.9.mod) = 3322
>>> +SHA256 (go/security_crowdsec/crowdsec-v1.0.9/v1.0.9.zip) =
>>0b61f7e5ed162796d14636243ffcc8c8e336a3a3ee7891115141447c7626e8f7
>>> +SIZE (go/security_crowdsec/crowdsec-v1.0.9/v1.0.9.zip) = 29314582
>>> 
>>> Added: head/security/crowdsec/files/crowdsec.in
>>>
>>==============================================================================
>>> --- /dev/null	00:00:00 1970	(empty, because file is newly added)
>>> +++ head/security/crowdsec/files/crowdsec.in	Wed Mar 24 15:45:18
>>2021	(r569135)
>>> @@ -0,0 +1,49 @@
>>> +#!/bin/sh
>>> +
>>> +# $FreeBSD$
>>> +#
>>> +# PROVIDE: crowdsec
>>> +# REQUIRE: LOGIN DAEMON NETWORKING
>>> +# 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".
>>> +# 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 ""
>>> +
>>> +. /etc/rc.subr
>>> +
>>> +name=crowdsec
>>> +desc="Crowdsec Agent"
>>> +rcvar=crowdsec_enable
>>> +
>>> +load_rc_config $name
>>> +
>>> +: ${crowdsec_enable:="NO"}
>>> +: ${crowdsec_config:="%%PREFIX%%/etc/crowdsec/config.yaml"}
>>> +: ${crowdsec_flags:=""}
>
>Unnecessary
>
>>> +
>>> +pidfile=/var/run/${name}.pid
>>> +command="%%PREFIX%%/bin/${name}"
>>procname="%%PREFIX%%/bin/${NAME}
>>command="/usr/sbin/daemon"
>>commandargs="-f -T ${name} -p ${pidfile} -- ${procname} -c
>>${crowdsec_config} ${crowdsec_flags}"
>>
>>And you don't need the _start() function
>
>Please also run it through rclint, and rc style is to not put braces
>around variable names unless in the middle of a word.
>
>Chris

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.


More information about the svn-ports-head mailing list