Bug 277832 - security/crowdsec: restart crashing service, improve scripts
Summary: security/crowdsec: restart crashing service, improve scripts
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-20 09:46 UTC by marco
Modified: 2024-03-28 10:47 UTC (History)
1 user (show)

See Also:


Attachments
patch for 1.6.0-3 (7.95 KB, patch)
2024-03-20 09:46 UTC, marco
no flags Details | Diff
patch for 1.6.0-3 (9.82 KB, patch)
2024-03-20 15:23 UTC, marco
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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!