kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
42 wiersze
875 B
Plaintext
Executable File
42 wiersze
875 B
Plaintext
Executable File
#!/sbin/openrc-run
|
|
# shellcheck shell=bash
|
|
|
|
NAME="funkwhaleworker"
|
|
PIDFILE="/var/run/$NAME.pid"
|
|
USER="funkwhale"
|
|
WORKDIR="/srv/funkwhale/api"
|
|
Celery="/srv/funkwhale/venv/bin/celery"
|
|
WORKER_ARGS="--app funkwhale_api.taskapp worker --loglevel INFO"
|
|
|
|
depend() {
|
|
need net
|
|
}
|
|
|
|
start() {
|
|
ebegin "Starting Funkwhale Worker"
|
|
cd /srv/funkwhale/api || exit 1
|
|
|
|
# shellcheck disable=SC1091
|
|
set -a && source /srv/funkwhale/config/.env && set +a
|
|
|
|
echo "Starting Funkwhale Worker"
|
|
# shellcheck disable=SC2086
|
|
start-stop-daemon --start \
|
|
--user "$USER" \
|
|
--make-pidfile \
|
|
--pidfile "$PIDFILE" \
|
|
--chdir "$WORKDIR" \
|
|
--exec "$Celery" \
|
|
-- $WORKER_ARGS \
|
|
>> /var/log/funk/worker.log 2>&1 &
|
|
echo "Funkwhale Worker started"
|
|
echo
|
|
eend $?
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Stopping Funkwhale Worker"
|
|
start-stop-daemon --stop --pidfile "$PIDFILE"
|
|
eend $?
|
|
}
|