funkwhale/deploy/FreeBSD/funkwhale_worker

40 wiersze
1.1 KiB
Plaintext
Czysty Zwykły widok Historia

2018-08-22 18:23:06 +00:00
#!/bin/sh
2022-11-24 20:14:59 +00:00
# shellcheck disable=SC2034
2018-08-22 18:23:06 +00:00
# PROVIDE: funkwhale_worker
# REQUIRE: LOGIN postgresql nginx redis
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable funkwhale_worker:
# funkwhale_worker (bool): Set it to "YES" to enable Funkwhale task worker.
# Default is "NO".
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
2022-11-24 20:14:59 +00:00
# shellcheck disable=SC1091
2018-08-22 18:23:06 +00:00
. /etc/rc.subr
desc="Funkwhale worker"
2022-11-24 20:14:59 +00:00
name="funkwhale_worker"
rcvar="funkwhale_worker_enable"
2018-08-22 18:23:06 +00:00
2022-11-24 20:14:59 +00:00
load_rc_config "$name"
2018-08-22 18:23:06 +00:00
2022-11-24 20:14:59 +00:00
: "${funkwhale_worker_enable:=NO}"
2018-08-22 18:23:06 +00:00
funkwhale_worker_chdir="/usr/local/www/funkwhale/api"
2022-11-24 20:14:59 +00:00
funkwhale_worker_user="funkwhale"
funkwhale_worker_env=$(grep -v '^#' /usr/local/www/funkwhale/config/.env | xargs)
2018-08-22 18:23:06 +00:00
pidfile="/var/run/funkwhale/${name##funkwhale_}.pid"
command_interpreter="/usr/local/www/funkwhale/venv/bin/python3"
2018-08-22 18:23:06 +00:00
command="/usr/local/www/funkwhale/venv/bin/celery"
2022-11-24 20:14:59 +00:00
command_args="\
--app funkwhale_api.taskapp \
worker \
--loglevel INFO \
--pidfile $pidfile \
2018-08-22 18:23:06 +00:00
>> /var/log/funkwhale/${name##funkwhale_}.log 2>&1 &"
run_rc_command "$1"