From 56b212362486f3e3b5ecfb635e308eeedff1fe2b Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 22 Feb 2019 09:02:51 -0500 Subject: [PATCH] Make local redis service optional --- sr.ht/builds.sr.ht/builds.sr.ht.init | 5 +++-- sr.ht/dispatch.sr.ht/dispatch.sr.ht.init | 8 +++++--- sr.ht/git.sr.ht/git.sr.ht.init | 5 +++-- sr.ht/hg.sr.ht/hg.sr.ht.init | 5 +++-- sr.ht/lists.sr.ht/lists.sr.ht.init | 5 +++-- sr.ht/man.sr.ht/man.sr.ht.init | 5 +++-- sr.ht/meta.sr.ht/meta.sr.ht.init | 5 +++-- sr.ht/todo.sr.ht/todo.sr.ht.init | 5 +++-- 8 files changed, 26 insertions(+), 17 deletions(-) diff --git a/sr.ht/builds.sr.ht/builds.sr.ht.init b/sr.ht/builds.sr.ht/builds.sr.ht.init index a69dec9..b07b842 100755 --- a/sr.ht/builds.sr.ht/builds.sr.ht.init +++ b/sr.ht/builds.sr.ht/builds.sr.ht.init @@ -7,12 +7,13 @@ BUILDS_USER=${BUILDS_USER:-builds} BUILDS_BIND=${BUILDS_BIND:-127.0.0.1:5000} BUILDS_ARGS=${BUILDS_ARGS:-} LOCAL_PG=${LOCAL_PG:-yes} +LOCAL_REDIS=${LOCAL_REDIS:-yes} LOGS=/var/log/builds.sr.ht.log depend() { need net - need redis - [ "$LOCAL_PG" == "yes" ] && need postgresql + [ "$LOCAL_REDIS" = "yes" ] && need redis + [ "$LOCAL_PG" = "yes" ] && need postgresql } start() { diff --git a/sr.ht/dispatch.sr.ht/dispatch.sr.ht.init b/sr.ht/dispatch.sr.ht/dispatch.sr.ht.init index ae0c9ea..93c544e 100755 --- a/sr.ht/dispatch.sr.ht/dispatch.sr.ht.init +++ b/sr.ht/dispatch.sr.ht/dispatch.sr.ht.init @@ -5,13 +5,15 @@ description="dispatch.sr.ht service" # Override these with /etc/conf.d/dispatch.sr.ht DISPATCH_USER=${DISPATCH_USER:-dispatch} DISPATCH_BIND=${DISPATCH_BIND:-127.0.0.1:5000} +DISPATCH_ARGS=${DISPATCH_ARGS:-} LOCAL_PG=${LOCAL_PG:-yes} +LOCAL_REDIS=${LOCAL_REDIS:-yes} LOGS=/var/log/dispatch.sr.ht.log depend() { need net - need redis - [ "$LOCAL_PG" == "yes" ] && need postgresql + [ "$LOCAL_REDIS" = "yes" ] && need redis + [ "$LOCAL_PG" = "yes" ] && need postgresql } start() { @@ -26,7 +28,7 @@ start() { --make-pidfile \ --pidfile /run/$name.pid \ --exec /usr/bin/gunicorn -- \ - dispatchsrht.app:app -b ${DISPATCH_BIND} + dispatchsrht.app:app -b ${DISPATCH_BIND} ${DISPATCH_ARGS} eend $? } diff --git a/sr.ht/git.sr.ht/git.sr.ht.init b/sr.ht/git.sr.ht/git.sr.ht.init index 8e2280b..c902b34 100755 --- a/sr.ht/git.sr.ht/git.sr.ht.init +++ b/sr.ht/git.sr.ht/git.sr.ht.init @@ -7,12 +7,13 @@ GIT_USER=${GIT_USER:-gitsrht} GIT_BIND=${GIT_BIND:-127.0.0.1:5001} GIT_ARGS=${GIT_ARGS:-} LOCAL_PG=${LOCAL_PG:-yes} +LOCAL_REDIS=${LOCAL_REDIS:-yes} LOGS=/var/log/git.sr.ht.log depend() { need net - need redis - [ "$LOCAL_PG" == "yes" ] && need postgresql + [ "$LOCAL_REDIS" = "yes" ] && need redis + [ "$LOCAL_PG" = "yes" ] && need postgresql } start() { diff --git a/sr.ht/hg.sr.ht/hg.sr.ht.init b/sr.ht/hg.sr.ht/hg.sr.ht.init index e9cd559..2d2fc72 100755 --- a/sr.ht/hg.sr.ht/hg.sr.ht.init +++ b/sr.ht/hg.sr.ht/hg.sr.ht.init @@ -7,12 +7,13 @@ HG_USER=${HG_USER:-hg} HG_BIND=${HG_BIND:-127.0.0.1:5001} HG_ARGS=${HG_ARGS:-} LOCAL_PG=${LOCAL_PG:-yes} +LOCAL_REDIS=${LOCAL_REDIS:-yes} LOGS=/var/log/hg.sr.ht.log depend() { need net - need redis - [ "$LOCAL_PG" == "yes" ] && need postgresql + [ "$LOCAL_REDIS" = "yes" ] && need redis + [ "$LOCAL_PG" = "yes" ] && need postgresql } start() { diff --git a/sr.ht/lists.sr.ht/lists.sr.ht.init b/sr.ht/lists.sr.ht/lists.sr.ht.init index c26c58f..5ec6a48 100755 --- a/sr.ht/lists.sr.ht/lists.sr.ht.init +++ b/sr.ht/lists.sr.ht/lists.sr.ht.init @@ -7,12 +7,13 @@ LISTS_USER=${LISTS_USER:-listssrht} LISTS_BIND=${LISTS_BIND:-127.0.0.1:5001} LISTS_ARGS=${LISTS_ARGS:-} LOCAL_PG=${LOCAL_PG:-yes} +LOCAL_REDIS=${LOCAL_REDIS:-yes} LOGS=/var/log/lists.sr.ht.log depend() { need net - need redis - [ "$LOCAL_PG" == "yes" ] && need postgresql + [ "$LOCAL_REDIS" = "yes" ] && need redis + [ "$LOCAL_PG" = "yes" ] && need postgresql } start() { diff --git a/sr.ht/man.sr.ht/man.sr.ht.init b/sr.ht/man.sr.ht/man.sr.ht.init index 2d9a0b1..5334f9e 100755 --- a/sr.ht/man.sr.ht/man.sr.ht.init +++ b/sr.ht/man.sr.ht/man.sr.ht.init @@ -7,12 +7,13 @@ MAN_USER=${MAN_USER:-man} MAN_BIND=${MAN_BIND:-127.0.0.1:5004} MAN_ARGS=${MAN_ARGS:-} LOCAL_PG=${LOCAL_PG:-yes} +LOCAL_REDIS=${LOCAL_REDIS:-yes} LOGS=/var/log/man.sr.ht.log depend() { need net - need redis - [ "$LOCAL_PG" == "yes" ] && need postgresql + [ "$LOCAL_REDIS" = "yes" ] && need redis + [ "$LOCAL_PG" = "yes" ] && need postgresql } start() { diff --git a/sr.ht/meta.sr.ht/meta.sr.ht.init b/sr.ht/meta.sr.ht/meta.sr.ht.init index e8b8d8e..f2456d9 100755 --- a/sr.ht/meta.sr.ht/meta.sr.ht.init +++ b/sr.ht/meta.sr.ht/meta.sr.ht.init @@ -7,12 +7,13 @@ META_USER=${META_USER:-meta} META_BIND=${META_BIND:-127.0.0.1:5000} META_ARGS=${META_ARGS:-} LOCAL_PG=${LOCAL_PG:-yes} +LOCAL_REDIS=${LOCAL_REDIS:-yes} LOGS=/var/log/meta.sr.ht.log depend() { need net - need redis - [ "$LOCAL_PG" == "yes" ] && need postgresql + [ "$LOCAL_REDIS" = "yes" ] && need redis + [ "$LOCAL_PG" = "yes" ] && need postgresql } start() { diff --git a/sr.ht/todo.sr.ht/todo.sr.ht.init b/sr.ht/todo.sr.ht/todo.sr.ht.init index 688b6dd..0f00e86 100755 --- a/sr.ht/todo.sr.ht/todo.sr.ht.init +++ b/sr.ht/todo.sr.ht/todo.sr.ht.init @@ -7,12 +7,13 @@ TODO_USER=${TODO_USER:-todo} TODO_BIND=${TODO_BIND:-127.0.0.1:5000} TODO_ARGS=${TODO_ARGS:-} LOCAL_PG=${LOCAL_PG:-yes} +LOCAL_REDIS=${LOCAL_REDIS:-yes} LOGS=/var/log/todo.sr.ht.log depend() { need net - need redis - [ "$LOCAL_PG" == "yes" ] && need postgresql + [ "$LOCAL_REDIS" = "yes" ] && need redis + [ "$LOCAL_PG" = "yes" ] && need postgresql } start() { -- 2.45.2