39 lines
1 KiB
Bash
Executable file
39 lines
1 KiB
Bash
Executable file
#!/bin/sh
|
|
# shellcheck disable=SC2034
|
|
|
|
# PROVIDE: funquail_worker
|
|
# REQUIRE: LOGIN postgresql nginx redis
|
|
# KEYWORD: shutdown
|
|
#
|
|
# Add the following lines to /etc/rc.conf to enable funquail_worker:
|
|
# funquail_worker (bool): Set it to "YES" to enable FunQuail task worker.
|
|
# Default is "NO".
|
|
|
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
|
|
|
|
# shellcheck disable=SC1091
|
|
. /etc/rc.subr
|
|
|
|
desc="FunQuail worker"
|
|
name="funquail_worker"
|
|
rcvar="funquail_worker_enable"
|
|
|
|
load_rc_config "$name"
|
|
|
|
: "${funquail_worker_enable:=NO}"
|
|
|
|
funquail_worker_chdir="/usr/local/www/funquail/api"
|
|
funquail_worker_user="funquail"
|
|
funquail_worker_env=$(grep -v '^#' /usr/local/www/funquail/config/.env | xargs)
|
|
pidfile="/var/run/funquail/${name##funquail_}.pid"
|
|
command_interpreter="/usr/local/www/funquail/venv/bin/python3"
|
|
|
|
command="/usr/local/www/funquail/venv/bin/celery"
|
|
command_args="\
|
|
--app funquail_api.taskapp \
|
|
worker \
|
|
--loglevel INFO \
|
|
--pidfile $pidfile \
|
|
>> /var/log/funquail/${name##funquail_}.log 2>&1 &"
|
|
|
|
run_rc_command "$1"
|