git: 98edd6659ce5 - main - devel/gitea-act_runner: Fix rc script

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Mon, 27 Oct 2025 13:44:10 UTC
The branch main has been updated by bofh:

URL: https://cgit.FreeBSD.org/ports/commit/?id=98edd6659ce543d63e8f59630c89a49627c0a4bf

commit 98edd6659ce543d63e8f59630c89a49627c0a4bf
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2025-10-27 13:41:44 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2025-10-27 13:43:39 +0000

    devel/gitea-act_runner: Fix rc script
    
    Change the variable act_runner_flags to act_runner_args as it is
    considered as an argument to command rather than the process.
    
    PR:             287384
    Reported by:    terehovv@mail.ru
---
 devel/gitea-act_runner/Makefile            |  2 +-
 devel/gitea-act_runner/files/act_runner.in | 25 +++++++++++++++----------
 devel/gitea-act_runner/pkg-message         |  9 +++++++++
 3 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/devel/gitea-act_runner/Makefile b/devel/gitea-act_runner/Makefile
index 7fdf95d4dadb..0a71fbe2d2a8 100644
--- a/devel/gitea-act_runner/Makefile
+++ b/devel/gitea-act_runner/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	act_runner
 DISTVERSIONPREFIX=	v
 DISTVERSION=	0.2.13
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	devel
 PKGNAMEPREFIX=	gitea-
 
diff --git a/devel/gitea-act_runner/files/act_runner.in b/devel/gitea-act_runner/files/act_runner.in
index 119b92aca300..d6c97ca0087a 100644
--- a/devel/gitea-act_runner/files/act_runner.in
+++ b/devel/gitea-act_runner/files/act_runner.in
@@ -23,30 +23,35 @@ load_rc_config "${name}"
 : ${act_runner_config:="%%ETCDIR%%/act_runner.conf"}
 : ${act_runner_cache_dir:="%%DATADIR%%"}
 : ${act_runner_log_dir:="/var/log/act_runner"}
+: ${act_runner_run_dir:="/var/run/act_runner"}
 : ${act_runner_log_file:="${act_runner_log_dir}/act_runner.log"}
-: ${act_runner_flags:="-c ${act_runner_config} daemon"}
+: ${act_runner_args:="-c ${act_runner_config} daemon"}
 
-procname="%%PREFIX%%/bin/act_runner"
+exec_name="%%PREFIX%%/bin/act_runner"
 command="/usr/sbin/daemon"
 
-pidfile="/var/run/${name}.pid"
+pidfile="${act_runner_run_dir}/${name}.pid"
 
 required_files=${act_runner_config}
+
+if [ -n "$act_runner_flags" ]; then
+  echo "act_runner_flags has been removed. Adjust the variable to be act_runner_args."
+  exit 1
+fi
+
 command_args=" -r -S -l ${act_runner_facility} -s ${act_runner_priority} \
     -T ${name} \
-    -u ${act_runner_user} -p ${pidfile} \
-    -o ${act_runner_log_file} \
-    ${procname} ${act_runner_flags}"
+    -u ${act_runner_user} -P ${pidfile} \
+    -o ${act_runner_log_file} ${exec_name} ${act_runner_args}"
 
-prestart_cmd="${name}_prestart"
+start_precmd="${name}_prestart"
 sig_stop=TERM
 
 act_runner_prestart() {
   #  ensure the log directories are owned by the unprivileged user
-  for d in "${act_runner_log_dir}"; do
+  for d in "${act_runner_log_dir} ${act_runner_run_dir}"; do
     if [ ! -e "$d" ]; then
-      mkdir "$d"
-      chown "${act_runner_user}" "$d"
+      install -d -o ${act_runner_user} -g ${act_runner_user} -m 755 ${d}
     fi
   done
 }
diff --git a/devel/gitea-act_runner/pkg-message b/devel/gitea-act_runner/pkg-message
index 61bf9945e09b..ce7632568e56 100644
--- a/devel/gitea-act_runner/pkg-message
+++ b/devel/gitea-act_runner/pkg-message
@@ -6,4 +6,13 @@ When configuring the runner, use 'host' as the label. e.g.
 act-runner register --labels FreeBSD:host,FreeBSD-14.3:host
 EOM
 }
+{ type: upgrade
+  message: <<EOM
+The rcvar act_runner_flags has been removed in lieu of act_runner_args.
+If the variable act_runner_flags is defined it will show an error while
+starting the service.
+
+Change the variable act_runner_flags to act_runner_args.
+EOM
+}
 ]