~dricottone/huttese-apk

ref: a884463161ec9529c0650702a7fa3473e5f2b3ef huttese-apk/sr.ht/git-send-email.io/git-send-email.io.init -rwxr-xr-x 821 bytes
a8844631 — Drew DeVault py3-celery: upgrade to 5.2.0 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/sbin/openrc-run
name="git-send-email.io"
description="git-send-email.io webhook service"

# Override these with /etc/conf.d/git-send-emaio.io
GITSENDEMAIL_USER=${GITSENDEMAIL_USER:-gitsendemail}
GITSENDEMAIL_BIND=${GITSENDEMAIL_BIND:-127.0.0.1:5001}
GITSENDEMAIL_ARGS=${GITSENDEMAIL_ARGS:-}
LOGS=/var/log/git-send-emaio.io.log

depend() {
	need net
}

start() {
	ebegin "Starting $name"
	touch "$LOGS"
	chown ${GITSENDEMAIL_USER} "$LOGS"
	start-stop-daemon \
		-u ${GITSENDEMAIL_USER} \
		-1 "$LOGS" \
		-2 "$LOGS" \
		--background \
		--make-pidfile \
		--pidfile /run/$name.pid \
		--exec /usr/bin/gunicorn -- \
			email_tutorial.app:app -b ${GITSENDEMAIL_BIND} ${GITSENDEMAIL_ARGS}
	eend $?
}

stop() {
	ebegin "Stopping $name"
	start-stop-daemon --stop --exec /usr/bin/gunicorn --pidfile /run/$name.pid
	eend $?
}