diff options
| author | Muhammad Moinur Rahman <bofh@FreeBSD.org> | 2025-10-04 10:54:57 +0000 |
|---|---|---|
| committer | Muhammad Moinur Rahman <bofh@FreeBSD.org> | 2025-10-04 11:59:22 +0000 |
| commit | d22a95905eb0ebf11522e0f49fb400528972399c (patch) | |
| tree | 7c6834355ab209e0da1630380ff11a9c6b155315 | |
| parent | ad5f4d630771dc99402ded2b8e41e000e8a87ee5 (diff) | |
devel/athens: Refactor
- Add UIS/GID for daemon process [1]
- Add pidfile for daemon process [2]
PR: 285274 [1] , 289865 [2]
Reported by: einar@isnic.is [1] , bob@vesterman.com [2]
| -rw-r--r-- | GIDs | 2 | ||||
| -rw-r--r-- | UIDs | 2 | ||||
| -rw-r--r-- | devel/athens/Makefile | 11 | ||||
| -rw-r--r-- | devel/athens/files/athens.in | 19 |
4 files changed, 26 insertions, 8 deletions
@@ -316,7 +316,7 @@ beam:*:372: mautrix-whatsapp:*:373: traccar:*:374: unpackerr:*:375: -# free: 376 +athens:*:376: hostd:*:377: walletd:*:378: renterd:*:379: @@ -322,7 +322,7 @@ beam:*:372:372::0:0:Erlang BEAM VM user:/nonexistent:/usr/sbin/nologin mautrix-whatsapp:*:373:373::0:0:Mautrix-Whatsapp Daemon:/nonexistent:/usr/sbin/nologin traccar:*:374:374::0:0:Traccar GPS Tracking Platform:/nonexistent:/usr/sbin/nologin unpackerr:*:375:375::0:0:Unpackerr Daemon:/nonexistent:/usr/sbin/nologin -# free: 376 +athens:*:376:376::0:0:Athens Go module registry:/nonexistent:/sbin/nologin hostd:*:377:377::0:0:hostd Daemon:/nonexistent:/usr/sbin/nologin walletd:*:378:378::0:0:walletd Daemon:/nonexistent:/usr/sbin/nologin renterd:*:379:379::0:0:renterd Daemon:/nonexistent:/usr/sbin/nologin diff --git a/devel/athens/Makefile b/devel/athens/Makefile index fdedcce7ab90..15669abb7384 100644 --- a/devel/athens/Makefile +++ b/devel/athens/Makefile @@ -1,6 +1,7 @@ PORTNAME= athens DISTVERSIONPREFIX= v DISTVERSION= 0.16.1 +PORTREVISION= 1 CATEGORIES= devel MAINTAINER= bofh@FreeBSD.org @@ -13,14 +14,20 @@ LICENSE_FILE= ${WRKSRC}/LICENSE USES= go:1.23,modules USE_RC_SUBR= ${PORTNAME} -BUILD_DATE= 2025-09-13-00:00:00-UTC - GO_MODULE= github.com/gomods/${PORTNAME} GO_TARGET= ./cmd/proxy GO_BUILDFLAGS= -ldflags " \ -X github.com/gomods/${PORTNAME}/pkg/build.version=${DISTVERSION} \ -X github.com/gomods/${PORTNAME}/pkg/build.buildDate=${BUILD_DATE}" +SUB_LIST= ATHENS_USER=${USERS} \ + ATHENS_GROUP=${GROUPS} + +USERS= ${PORTNAME} +GROUPS= ${PORTNAME} + +BUILD_DATE= 2025-09-13-00:00:00-UTC + do-install: ${INSTALL_PROGRAM} ${WRKDIR}/bin/proxy ${STAGEDIR}${PREFIX}/bin/${PORTNAME} diff --git a/devel/athens/files/athens.in b/devel/athens/files/athens.in index 2c59b63c0f91..f9857d8fd2ef 100644 --- a/devel/athens/files/athens.in +++ b/devel/athens/files/athens.in @@ -1,7 +1,7 @@ #!/bin/sh # # PROVIDE: athens -# REQUIRE: networking +# REQUIRE: LOGIN networking # KEYWORD: shutdown # # athens_enable (bool): @@ -12,17 +12,28 @@ # Default value %%ETCDIR%%/athens.toml # Path to the athens configuration file # +# athens_user (string) +# This is the user that athens runs as +# Set to %%ATHENS_USER%% by default +# +# athens_group (string) +# This is the group that athens runs as +# Set to %%ATHENS_GROUP%% by default . /etc/rc.subr +name=athens +rcvar=athens_enable + : ${athens_enable:="NO"} : ${athens_config:="%%ETCDIR%%/athens.toml"} +: ${athens_user:=%%ATHENS_USER%%} +: ${athens_group:=%%ATHENS_GROUP%%} +: ${athens_pidfile:="/var/run/athens.pid"} -name=athens -rcvar=athens_enable athens_command="%%PREFIX%%/bin/athens -config_file ${athens_config}" command="/usr/sbin/daemon" -command_args="-S ${athens_command}" +command_args="-p ${athens_pidfile} -u ${athens_user} -S ${athens_command}" PATH="${PATH}:%%PREFIX%%/bin" |
