M sr.ht/lists.sr.ht/APKBUILD => sr.ht/lists.sr.ht/APKBUILD +3 -0
@@ 22,6 22,7 @@ source="
lists.sr.ht.init
lists.sr.ht-process.init
lists.sr.ht-lmtp.init
+ lists.sr.ht-webhooks.init
"
builddir="$srcdir/$pkgname-$pkgver"
export PKGVER=$pkgver
@@ 42,6 43,8 @@ package() {
"$pkgdir"/etc/init.d/lists.sr.ht-lmtp
install -Dm755 "$srcdir"/lists.sr.ht-process.init \
"$pkgdir"/etc/init.d/lists.sr.ht-process
+ install -Dm755 "$srcdir"/lists.sr.ht-webhooks.init \
+ "$pkgdir"/etc/init.d/lists.sr.ht-webhooks
}
sha512sums="80132b5b6af35902ac40be9202916a94257e62b348d5a60bf79fc6faeda319d7ed1639e486ab21c5906818c0b7176dc5658f995114343bf647ef46e803350116 lists.sr.ht-0.14.1.tar.gz
A sr.ht/lists.sr.ht/lists.sr.ht-webhooks.init => sr.ht/lists.sr.ht/lists.sr.ht-webhooks.init +36 -0
@@ 0,0 1,36 @@
+#!/sbin/openrc-run
+name="lists.sr.ht-webhooks"
+description="lists.sr.ht webhook delivery service"
+
+# Override these with /etc/conf.d/lists.sr.ht-webhooks
+LISTS_USER=${LISTS_USER:-listssrht}
+LOCAL_PG=${LOCAL_PG:-yes}
+LOGS=/var/log/lists.sr.ht-webhooks.log
+
+depend() {
+ need net
+ need redis
+ [ "$LOCAL_PG" == "yes" ] && need postgresql
+}
+
+start() {
+ ebegin "Starting $name"
+ touch "$LOGS"
+ chown ${LISTS_USER} "$LOGS"
+ start-stop-daemon \
+ -u ${LISTS_USER} \
+ -1 "$LOGS" \
+ -2 "$LOGS" \
+ --background \
+ --make-pidfile \
+ --pidfile /run/$name.pid \
+ --exec /usr/bin/celery -- \
+ -A listssrht.webhooks worker --loglevel=info
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping $name"
+ start-stop-daemon --stop --exec /usr/bin/celery --pidfile /run/$name.pid
+ eend $?
+}