aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Neumeister <joneum@FreeBSD.org>2026-10-03 11:19:11 +0000
committerJochen Neumeister <joneum@FreeBSD.org>2026-10-03 11:20:39 +0000
commit0dfc5a94ecfc2cf61a7cdc19b6249a942eeeef76 (patch)
treea92fc2214c86b8c6c518c026ee9c178dcf5ace17
parent729d140b6d5e0221e1dca4df0941f6d1e171865f (diff)
net-mgmt/semaphore: Write rc script output to a log file
Redirect stdout and stderr of the service to /var/log/semaphore.log. The path can be changed with semaphore_logfile in rc.conf. PR: 298453 Approved by: egypcio (maintainer timeout) Sponsored by: Netzkommune GmbH
-rw-r--r--net-mgmt/semaphore/Makefile2
-rw-r--r--net-mgmt/semaphore/files/semaphore.in7
2 files changed, 7 insertions, 2 deletions
diff --git a/net-mgmt/semaphore/Makefile b/net-mgmt/semaphore/Makefile
index 67bdb8024f4e..c743aae767f7 100644
--- a/net-mgmt/semaphore/Makefile
+++ b/net-mgmt/semaphore/Makefile
@@ -1,7 +1,7 @@
PORTNAME= semaphore
DISTVERSIONPREFIX= v
DISTVERSION= 2.19.7
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= net-mgmt
MASTER_SITES+= https://github.com/joneum/FreeBSD-Semaphore/releases/download/${PORTNAME}-${DISTVERSION}/:webui
DISTFILES+= ${PORTNAME}-webui-${DISTVERSION}${EXTRACT_SUFX}:webui \
diff --git a/net-mgmt/semaphore/files/semaphore.in b/net-mgmt/semaphore/files/semaphore.in
index 70b0e159baba..02a9f26186f5 100644
--- a/net-mgmt/semaphore/files/semaphore.in
+++ b/net-mgmt/semaphore/files/semaphore.in
@@ -3,6 +3,10 @@
# PROVIDE: semaphore
# REQUIRE: LOGIN
# KEYWORD: shutdown
+#
+# semaphore_enable (bool): Set to NO by default.
+# semaphore_config (str): Configuration file to use.
+# semaphore_logfile (str): File to write stdout and stderr to.
. /etc/rc.subr
@@ -13,12 +17,13 @@ load_rc_config ${name}
: ${semaphore_enable:="NO"}
: ${semaphore_config="%%PREFIX%%/etc/semaphore/config.json"}
+: ${semaphore_logfile="/var/log/${name}.log"}
export PATH=${PATH}:%%PREFIX%%/bin
pidfile="/var/run/${name}.pid"
procname="%%PREFIX%%/bin/semaphore"
command="/usr/sbin/daemon"
-command_args="-f -c -p ${pidfile} /usr/bin/env ${semaphore_env} ${procname} server --config \"${semaphore_config}\""
+command_args="-f -c -o ${semaphore_logfile} -p ${pidfile} /usr/bin/env ${semaphore_env} ${procname} server --config \"${semaphore_config}\""
run_rc_command "$1"