From f57497b49b7ce6914e2dc610bb49f46da0746fdb Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 28 Jan 2019 13:18:20 -0500 Subject: [PATCH] Add additional openrc services for lists.sr.ht --- sr.ht/lists.sr.ht/APKBUILD | 12 ++++++-- sr.ht/lists.sr.ht/lists.sr.ht-lmtp.init | 35 +++++++++++++++++++++ sr.ht/lists.sr.ht/lists.sr.ht-process.init | 36 ++++++++++++++++++++++ 3 files changed, 81 insertions(+), 2 deletions(-) create mode 100755 sr.ht/lists.sr.ht/lists.sr.ht-lmtp.init create mode 100755 sr.ht/lists.sr.ht/lists.sr.ht-process.init diff --git a/sr.ht/lists.sr.ht/APKBUILD b/sr.ht/lists.sr.ht/APKBUILD index 0eb4a78..d55b882 100644 --- a/sr.ht/lists.sr.ht/APKBUILD +++ b/sr.ht/lists.sr.ht/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Drew DeVault pkgname=lists.sr.ht pkgver=0.14.1 -pkgrel=0 +pkgrel=1 pkgdesc="sr.ht mailing list service" url="https://git.sr.ht/~sircmpwn/lists.sr.ht" arch="noarch" @@ -20,6 +20,8 @@ subpackages="${pkgname}-openrc" source=" $pkgname-$pkgver.tar.gz::https://git.sr.ht/~sircmpwn/$pkgname/archive/$pkgver.tar.gz lists.sr.ht.init + lists.sr.ht-process.init + lists.sr.ht-lmtp.init " builddir="$srcdir/$pkgname-$pkgver" export PKGVER=$pkgver @@ -36,7 +38,13 @@ package() { python3 setup.py install --root="$pkgdir" --optimize=1 mkdir -p "$pkgdir"/etc/init.d install -Dm755 "$srcdir"/lists.sr.ht.init "$pkgdir"/etc/init.d/lists.sr.ht + install -Dm755 "$srcdir"/lists.sr.ht-process.init \ + "$pkgdir"/etc/init.d/lists.sr.ht-lmtp + install -Dm755 "$srcdir"/lists.sr.ht-lmtp.init \ + "$pkgdir"/etc/init.d/lists.sr.ht-process } sha512sums="80132b5b6af35902ac40be9202916a94257e62b348d5a60bf79fc6faeda319d7ed1639e486ab21c5906818c0b7176dc5658f995114343bf647ef46e803350116 lists.sr.ht-0.14.1.tar.gz -12d18641115a9f78e25f19a45686192d4f1123a58bfd8f5cd0a0e6e5b360af422309e405eedb46805a0f57913d7f2b0b99550895fa0e44654ed467a934a10fc6 lists.sr.ht.init" +12d18641115a9f78e25f19a45686192d4f1123a58bfd8f5cd0a0e6e5b360af422309e405eedb46805a0f57913d7f2b0b99550895fa0e44654ed467a934a10fc6 lists.sr.ht.init +f5e5d188c3a6ced902d7965af4a5f4d1e2ebcdef9d57a2ac73b179e0a7ca60ab96f19ce3e8b63657f32fb7e8d0eb43588e716349d9d8965cdacbfc37c59d9593 lists.sr.ht-process.init +a1b95550a715eecc2a4ce5d4675748ec7f2c514646710b6326882513b81cc19ac02e463f7e8b48f3e45d5115ea8c6b81ad3d92547e5a13b2a9e521c9502dbb65 lists.sr.ht-lmtp.init" diff --git a/sr.ht/lists.sr.ht/lists.sr.ht-lmtp.init b/sr.ht/lists.sr.ht/lists.sr.ht-lmtp.init new file mode 100755 index 0000000..15c47fa --- /dev/null +++ b/sr.ht/lists.sr.ht/lists.sr.ht-lmtp.init @@ -0,0 +1,35 @@ +#!/sbin/openrc-run +name="lists.sr.ht-lmtp" +description="lists.sr.ht mail ingress service" + +# Override these with /etc/conf.d/lists.sr.ht-process +LISTS_USER=${LISTS_USER:-listssrht} +LOCAL_PG=${LOCAL_PG:-yes} +LOGS=/var/log/lists.sr.ht-lmtp.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/listssrht-lmtp + eend $? +} + +stop() { + ebegin "Stopping $name" + start-stop-daemon --stop --exec /usr/bin/listssrht-lmtp --pidfile /run/$name.pid + eend $? +} diff --git a/sr.ht/lists.sr.ht/lists.sr.ht-process.init b/sr.ht/lists.sr.ht/lists.sr.ht-process.init new file mode 100755 index 0000000..36b37de --- /dev/null +++ b/sr.ht/lists.sr.ht/lists.sr.ht-process.init @@ -0,0 +1,36 @@ +#!/sbin/openrc-run +name="lists.sr.ht-process" +description="lists.sr.ht mail processing service" + +# Override these with /etc/conf.d/lists.sr.ht-process +LISTS_USER=${LISTS_USER:-listssrht} +LOCAL_PG=${LOCAL_PG:-yes} +LOGS=/var/log/lists.sr.ht-process.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.process worker + eend $? +} + +stop() { + ebegin "Stopping $name" + start-stop-daemon --stop --exec /usr/bin/celery --pidfile /run/$name.pid + eend $? +} -- 2.45.2