Bug 277832

Summary: security/crowdsec: restart crashing service, improve scripts
Product: Ports & Packages Reporter: marco
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed Overcome By Events    
Severity: Affects Many People CC: dutra
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch for 1.6.0-3
none
patch for 1.6.0-3 none

Description marco 2024-03-20 09:46:45 UTC
Created attachment 249323 [details]
patch for 1.6.0-3

The current version, although using sbin/daemon, did not restart if the process crashed for any reason (panic, OOM, kill -TERM).

This patch does it and simplifies a few more things.

No change to the binaries.
Comment 1 marco 2024-03-20 15:23:08 UTC
Created attachment 249341 [details]
patch for 1.6.0-3

The second version of the patch includes a change to the binary behavior as well: avoid writing over the memory mapped file + ensure the process is reloaded after a data file was changed.
Comment 2 Gabriel M. Dutra freebsd_committer freebsd_triage 2024-03-20 20:18:36 UTC
Hi,

I got a error on apply, see:

root@poudriere:/usr/local/poudriere/ports/HEAD # git apply patch
patch:175: space before tab in indent.
 	"io"
patch:176: space before tab in indent.
 	"net/http"
patch:177: space before tab in indent.
 	"os"
patch:179: space before tab in indent.
 	"time"
patch:180: trailing whitespace.

error: patch failed: security/crowdsec/Makefile:1
error: security/crowdsec/Makefile: patch does not apply
error: patch failed: security/crowdsec/files/crowdsec.in:20
error: security/crowdsec/files/crowdsec.in: patch does not apply
error: security/crowdsec/files/patch-pkg_cwhub_dataset.go: already exists in working directory
error: patch failed: security/crowdsec/files/pkg-deinstall.in:1
error: security/crowdsec/files/pkg-deinstall.in: patch does not apply
error: patch failed: security/crowdsec/files/pkg-install.in:1
error: security/crowdsec/files/pkg-install.in: patch does not apply
error: patch failed: security/crowdsec/files/upgrade-hub.in:1
error: security/crowdsec/files/upgrade-hub.in: patch does not apply
Comment 3 marco 2024-03-20 21:20:28 UTC
Oh, I see the issue, but I created the patch with "git patch" and it applies cleanly with "patch -p1".

I'll see why asap, thanks
Comment 4 marco 2024-03-20 21:36:55 UTC
Ok, it seems like the git default should be a warning. If it's not, just ignore it with

git apply --whitespace=nowarn
Comment 5 marco 2024-03-28 10:47:42 UTC
Hi,

just checking if you need anything else from me, because the patch applies cleanly if I ignore the whitespaces with the above command.

Thanks!
Comment 6 marco 2024-05-02 22:18:23 UTC
Closing this one because I'll submit v1.6.1 asap.