From 460e3f4a4bc54d2f8b6945c7b7fe2ac29f07533b Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 18 Mar 2019 10:10:05 +0100 Subject: [PATCH] Revert "Update README.md" This reverts commit d6d609af767bc74eff3ca59a64b302a197397e10 --- deploy/Gentoo/.gitkeep | 0 deploy/Gentoo/README.md | 19 +++++++++++++++++++ deploy/Gentoo/funkwhale_beat | 27 +++++++++++++++++++++++++++ deploy/Gentoo/funkwhale_server | 29 +++++++++++++++++++++++++++++ deploy/Gentoo/funkwhale_worker | 28 ++++++++++++++++++++++++++++ 5 files changed, 103 insertions(+) create mode 100644 deploy/Gentoo/.gitkeep create mode 100644 deploy/Gentoo/README.md create mode 100644 deploy/Gentoo/funkwhale_beat create mode 100644 deploy/Gentoo/funkwhale_server create mode 100644 deploy/Gentoo/funkwhale_worker diff --git a/deploy/Gentoo/.gitkeep b/deploy/Gentoo/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/deploy/Gentoo/README.md b/deploy/Gentoo/README.md new file mode 100644 index 000000000..b4f90b660 --- /dev/null +++ b/deploy/Gentoo/README.md @@ -0,0 +1,19 @@ +### 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 diff --git a/deploy/Gentoo/funkwhale_beat b/deploy/Gentoo/funkwhale_beat new file mode 100644 index 000000000..49d427437 --- /dev/null +++ b/deploy/Gentoo/funkwhale_beat @@ -0,0 +1,27 @@ +#!/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 $? +} diff --git a/deploy/Gentoo/funkwhale_server b/deploy/Gentoo/funkwhale_server new file mode 100644 index 000000000..926bd01d1 --- /dev/null +++ b/deploy/Gentoo/funkwhale_server @@ -0,0 +1,29 @@ +#!/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 $? +} diff --git a/deploy/Gentoo/funkwhale_worker b/deploy/Gentoo/funkwhale_worker new file mode 100644 index 000000000..faa54f292 --- /dev/null +++ b/deploy/Gentoo/funkwhale_worker @@ -0,0 +1,28 @@ +#!/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 $? +}