#!/bin/sh # shellcheck disable=SC2034 # PROVIDE: funquail_beat # REQUIRE: LOGIN postgresql nginx redis # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable funquail_beat: # funquail_beat (bool): Set it to "YES" to enable FunQuail task beat. # Default is "NO". PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin # shellcheck disable=SC1091 . /etc/rc.subr desc="FunQuail beat" name="funquail_beat" rcvar="funquail_beat_enable" load_rc_config "$name" : "${funquail_beat_enable:=NO}" funquail_beat_chdir="/usr/local/www/funquail/api" funquail_beat_user="funquail" funquail_beat_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 \ beat \ --loglevel INFO \ --pidfile $pidfile \ >> /var/log/funquail/${name##funquail_}.log 2>&1 &" run_rc_command "$1"