aboutsummaryrefslogtreecommitdiff
path: root/devel/gitea-act_runner/files/act_runner.in
diff options
context:
space:
mode:
Diffstat (limited to 'devel/gitea-act_runner/files/act_runner.in')
-rw-r--r--devel/gitea-act_runner/files/act_runner.in25
1 files changed, 15 insertions, 10 deletions
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
}