From f357e5fe94b95b764cbe5a1724ee9823ebaa62e4 Mon Sep 17 00:00:00 2001 From: Alarig Le Lay Date: Sat, 28 Dec 2024 08:51:02 +0100 Subject: [PATCH] net-misc/stayrtr: caps and init fix Signed-off-by: Alarig Le Lay --- net-misc/stayrtr/files/stayrtr-init.d | 9 +++++++++ net-misc/stayrtr/stayrtr-0.6.1.ebuild | 9 ++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/net-misc/stayrtr/files/stayrtr-init.d b/net-misc/stayrtr/files/stayrtr-init.d index 3634885..491b3ab 100644 --- a/net-misc/stayrtr/files/stayrtr-init.d +++ b/net-misc/stayrtr/files/stayrtr-init.d @@ -6,8 +6,17 @@ name="stayrtr daemon" description="RPKI-To-Router server implementation in Go" command=/usr/bin/stayrtr command_args="${STAYRTR_OPTS}" +pidfile="/run/${RC_SVCNAME}.pid" +command_background=true +start_stop_daemon_args="--user ${RC_SVCNAME} --group ${RC_SVCNAME} \ + --stdout /var/log/${RC_SVCNAME}.log \ + --stderr /var/log/${RC_SVCNAME}.log" depend() { use net use logger } + +start_pre() { + checkpath -f -m 0755 -o ${RC_SVCNAME}:${RC_SVCNAME} "/var/log/${RC_SVCNAME}.log" +} diff --git a/net-misc/stayrtr/stayrtr-0.6.1.ebuild b/net-misc/stayrtr/stayrtr-0.6.1.ebuild index 06b0f8e..9c6c56a 100644 --- a/net-misc/stayrtr/stayrtr-0.6.1.ebuild +++ b/net-misc/stayrtr/stayrtr-0.6.1.ebuild @@ -3,7 +3,7 @@ EAPI=8 -inherit go-module systemd +inherit fcaps go-module systemd DESCRIPTION="RPKI-To-Router server implementation in Go" HOMEPAGE="https://github.com/bgp/stayrtr" @@ -21,6 +21,13 @@ RDEPEND=" " DEPEND="${RDEPEND}" + +FILECAPS=( + CAP_NET_ADMIN usr/bin/stayrtr + CAP_NET_BIND_SERVICE usr/bin/stayrtr + CAP_NET_RAW usr/bin/stayrtr +) + src_compile() { ego build -trimpath -ldflags "-X main.version=${PV}" ${GOFLAGS} ./cmd/stayrtr/stayrtr.go ego build -trimpath -ldflags "-X main.version=${PV}" ${GOFLAGS} ./cmd/rtrdump/rtrdump.go