Files
2026-10-04 04:07:15 +00:00

55 lines
1.3 KiB
Bash

#!/bin/sh
# PROVIDE: act_runner
# REQUIRE: NETWORKING SYSLOG
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable act_runner:
#
# act_runner_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable act_runner.
. /etc/rc.subr
name="act_runner"
rcvar="act_runner_enable"
load_rc_config "${name}"
: ${act_runner_enable:="NO"}
: ${act_runner_facility:="daemon"}
: ${act_runner_priority:="debug"}
: ${act_runner_config:="%%ETCDIR%%/act_runner.conf"}
: ${act_runner_log_dir:="%%LOGDIR%%"}
: ${act_runner_log_file:="${name}.log"}
: ${act_runner_args:="-c ${act_runner_config} daemon"}
command="/usr/sbin/daemon"
pidfile="%%PIDDIR%%/${name}.pid"
exec_path="%%PREFIX%%/bin/act_runner"
required_files=${act_runner_config}
prestart_cmd="${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
if [ ! -e "$d" ]; then
mkdir "$d"
chown "${act_runner_user}" "$d"
fi
done
}
command_args=" -r -S -l ${act_runner_facility} -s ${act_runner_priority} \
-T ${name} \
-P ${pidfile} \
-o ${act_runner_log_dir}/${act_runner_log_file} \
-u %%ACT_RUNNER_USER%% \
${exec_path} ${act_runner_args}"
run_rc_command "$1"