2019-03-18 09:10:05 +00:00
|
|
|
#!/sbin/openrc-run
|
|
|
|
|
|
|
|
NAME=funkwhaleserver
|
|
|
|
PIDFILE=/var/run/$NAME.pid
|
|
|
|
USER=funkwhale
|
2019-06-19 08:26:09 +00:00
|
|
|
DAEMON_ARGS="config.asgi:application -w 4 -k uvicorn.workers.UvicornWorker -b 127.0.0.1:5000 "
|
|
|
|
Gunicorn=/srv/funkwhale/virtualenv/bin/gunicorn
|
|
|
|
WORKDIR=/srv/funkwhale/api
|
2019-03-18 09:10:05 +00:00
|
|
|
|
|
|
|
depend() {
|
|
|
|
need net redis postgresql nginx funkwhale_beat funkwhale_worker
|
|
|
|
}
|
|
|
|
|
|
|
|
start() {
|
|
|
|
ebegin "Starting Funkwhale Server"
|
|
|
|
cd /srv/funkwhale/api
|
|
|
|
set -a && source /srv/funkwhale/config/.env && set +a
|
|
|
|
echo 'Starting Funkwhale Server'
|
2019-06-19 08:26:09 +00:00
|
|
|
start-stop-daemon --start --user $USER --make-pidfile --pidfile $PIDFILE -d $WORKDIR --exec $Gunicorn -- $DAEMON_ARGS >> /var/log/funk/server.log 2>&1&
|
2019-03-18 09:10:05 +00:00
|
|
|
echo 'Funkwhale Server started'
|
|
|
|
echo
|
|
|
|
eend $?
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
ebegin "Stopping Funkwhale"
|
|
|
|
start-stop-daemon --stop --pidfile $PIDFILE
|
|
|
|
eend $?
|
|
|
|
}
|