Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Mar 2021 16:12:04 +0000
From:      Chris Rees <crees@bayofrum.net>
To:        Baptiste Daroussin <bapt@FreeBSD.org>, Sofian Brabez <sbz@FreeBSD.org>
Cc:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   Re: svn commit: r569135 - in head/security/crowdsec: . files
Message-ID:  <B08954DA-9EFD-4C84-B912-F7B13AFC918F@bayofrum.net>
In-Reply-To: <20210324155631.zvtmepz7ropprvwm@aniel.nours.eu>
References:  <202103241545.12OFjJvO092197@repo.freebsd.org> <20210324155631.zvtmepz7ropprvwm@aniel.nours.eu>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Sofian,

Sorry, feel as though I'm piling on here!

On 24 March 2021 15:56:31 GMT, Baptiste Daroussin <bapt@FreeBSD=2Eorg> wro=
te:
>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=2Efreebsd=2Eorg/changeset/ports/569135
>>=20
>> Log:
>>   - Update to 1=2E0=2E9
>>   - Add rc=2Ed script
>>=20
>> Added:
>>   head/security/crowdsec/files/
>>   head/security/crowdsec/files/crowdsec=2Ein   (contents, props
>changed)
>> Modified:
>>   head/security/crowdsec/Makefile
>>   head/security/crowdsec/distinfo   (contents, props changed)
>>=20
>> Modified: head/security/crowdsec/Makefile
>>
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
>> --- 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$
>> =20
>>  PORTNAME=3D	crowdsec
>> -PORTVERSION=3D	1=2E0=2E7
>> +PORTVERSION=3D	1=2E0=2E9
>>  DISTVERSIONPREFIX=3D	v
>>  CATEGORIES=3D	security
>> =20
>> @@ -20,6 +20,8 @@ GO_BUILDFLAGS=3D	-ldflags "-s -w \
>> =20
>>  GO_TARGET=3D	=2E/cmd/crowdsec \
>>  		=2E/cmd/crowdsec-cli
>> +
>> +USE_RC_SUBR=3D	crowdsec
>> =20
>>  PLIST_FILES=3D	bin/crowdsec \
>>  		bin/crowdsec-cli
>>=20
>> Modified: head/security/crowdsec/distinfo
>>
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
>> --- 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 =3D 1615033328
>> -SHA256 (go/security_crowdsec/crowdsec-v1=2E0=2E7/v1=2E0=2E7=2Emod) =3D
>810ca243ce2951dd7ab23d955efc8f50410c94feb8babc47a783146a4c06c798
>> -SIZE (go/security_crowdsec/crowdsec-v1=2E0=2E7/v1=2E0=2E7=2Emod) =3D 3=
310
>> -SHA256 (go/security_crowdsec/crowdsec-v1=2E0=2E7/v1=2E0=2E7=2Ezip) =3D
>1d7f5956826096405b24684db3c924476ffb7fa02f5859af5a6a2c00d8b1d753
>> -SIZE (go/security_crowdsec/crowdsec-v1=2E0=2E7/v1=2E0=2E7=2Ezip) =3D 2=
9305256
>> +TIMESTAMP =3D 1616585825
>> +SHA256 (go/security_crowdsec/crowdsec-v1=2E0=2E9/v1=2E0=2E9=2Emod) =3D
>b95c6a35287b10ff019c2c3391bad1d0759415cf53cb7c0bfe7b154e479f6531
>> +SIZE (go/security_crowdsec/crowdsec-v1=2E0=2E9/v1=2E0=2E9=2Emod) =3D 3=
322
>> +SHA256 (go/security_crowdsec/crowdsec-v1=2E0=2E9/v1=2E0=2E9=2Ezip) =3D
>0b61f7e5ed162796d14636243ffcc8c8e336a3a3ee7891115141447c7626e8f7
>> +SIZE (go/security_crowdsec/crowdsec-v1=2E0=2E9/v1=2E0=2E9=2Ezip) =3D 2=
9314582
>>=20
>> Added: head/security/crowdsec/files/crowdsec=2Ein
>>
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
>> --- /dev/null	00:00:00 1970	(empty, because file is newly added)
>> +++ head/security/crowdsec/files/crowdsec=2Ein	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=2Econf=2Elocal or /etc/rc=2Econf
>> +# to enable this service:
>> +#
>> +# crowdsec_enable (bool):	Set it to YES to enable crowdsec agent=2E
>> +#				Default is "NO"=2E
>> +# crowdsec_config (str):	Set the agent config path=2E
>> +#				Default is "%%PREFIX%%/etc/crowdsec/config=2Eyaml"=2E
>> +# crowdsec_flags (str):	Set the extra flags to run agent=2E
>> +#				Default is ""
>> +
>> +=2E /etc/rc=2Esubr
>> +
>> +name=3Dcrowdsec
>> +desc=3D"Crowdsec Agent"
>> +rcvar=3Dcrowdsec_enable
>> +
>> +load_rc_config $name
>> +
>> +: ${crowdsec_enable:=3D"NO"}
>> +: ${crowdsec_config:=3D"%%PREFIX%%/etc/crowdsec/config=2Eyaml"}
>> +: ${crowdsec_flags:=3D""}

Unnecessary

>> +
>> +pidfile=3D/var/run/${name}=2Epid
>> +command=3D"%%PREFIX%%/bin/${name}"
>procname=3D"%%PREFIX%%/bin/${NAME}
>command=3D"/usr/sbin/daemon"
>commandargs=3D"-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 aroun=
d variable names unless in the middle of a word=2E

Chris



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B08954DA-9EFD-4C84-B912-F7B13AFC918F>