Skip to content
Snippets Groups Projects
Commit b1caabbe authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Merge branch 'develop' into 'develop'

Add Gentoo/openrc initscripts

See merge request funkwhale/funkwhale!678
parents 7b9343bc 460e3f4a
No related branches found
No related tags found
No related merge requests found
### Gentoo init scripts
Copy the files to `/etc/init.d/`
```
# cp /path/to/scripts/funkwhale_* /etc/init.d/
```
Make the files executable:
```
# chmod +x /etc/init.d/funkwhale_*
```
Starting funkwhale_server will automatically start the other two, as well as nginx and redis.
```
# rc-service funkwhale_server start
```
\ No newline at end of file
#!/sbin/openrc-run
NAME=funkwhalebeat
PIDFILE=/var/run/$NAME.pid
USER=funkwhale
WORKDIR=/srv/funkwhale/api
Celery=/srv/funkwhale/virtualenv/bin/celery
BEAT_ARGS="-A funkwhale_api.taskapp beat -l INFO"
depend() {
need net
}
start() {
ebegin "Starting Funkwhale Beat"
cd /srv/funkwhale/api
set -a && source /srv/funkwhale/config/.env && set +a
echo ' start beat'
start-stop-daemon --start --user $USER --make-pidfile --pidfile $PIDFILE -d $WORKDIR --exec $Celery -- $BEAT_ARGS >> /var/log/funk/worker.log 2>&1&
echo 'Started Beat'
echo
eend $?
}
stop() {
ebegin "Stopping Funkwhale Beat"
start-stop-daemon --stop --pidfile $PIDFILE
eend $?
}
#!/sbin/openrc-run
NAME=funkwhaleserver
PIDFILE=/var/run/$NAME.pid
USER=funkwhale
DAEMON_ARGS="-b 127.0.0.1 -p 5000 config.asgi:application --proxy-headers "
Daphne=/srv/funkwhale/virtualenv/bin/daphne
WORKDIR=/srv/funkwhale/api
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'
start-stop-daemon --start --user $USER --make-pidfile --pidfile $PIDFILE -d $WORKDIR --exec $Daphne -- $DAEMON_ARGS >> /var/log/funk/daphne.log 2>&1&
echo 'Funkwhale Server started'
echo
eend $?
}
stop() {
ebegin "Stopping Funkwhale"
start-stop-daemon --stop --pidfile $PIDFILE
eend $?
}
#!/sbin/openrc-run
NAME=funkwhaleworker
PIDFILE=/var/run/$NAME.pid
USER=funkwhale
WORKDIR=/srv/funkwhale/api
Celery=/srv/funkwhale/virtualenv/bin/celery
WORKER_ARGS=" -A funkwhale_api.taskapp worker -l INFO"
depend() {
need net
}
start() {
ebegin "Starting Funkwhale Worker"
cd /srv/funkwhale/api
set -a && source /srv/funkwhale/config/.env && set +a
echo ' start beat'
start-stop-daemon --start --user $USER --make-pidfile --pidfile $PIDFILE -d $WORKDIR --exec $Celery -- $WORKER_ARGS >> /var/log/funk/worker.log 2>&1&
echo 'Started Worker'
echo
eend $?
}
stop() {
ebegin "Stopping Funkwhale Worker"
start-stop-daemon --stop --pidfile $PIDFILE
eend $?
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment