#!/sbin/openrc-run
name="legacy.sr.ht-shim"
description="legacy.sr.ht shim API service"
supervisor=supervise-daemon
LEGACYSHIM_USER=${LEGACYSHIM_USER:-legacyshim}
LEGACYSHIM_BIND=${LEGACYSHIM_BIND:-127.0.0.1:5013}
LEGACYSHIM_ARGS=${LEGACYSHIM_ARGS:-}
LOGS=/var/log/legacy.sr.ht-shim.log
supervise_daemon_args="-1 $LOGS -2 $LOGS"
command="/usr/bin/gunicorn"
command_args="legacyshim.app:app -b $LEGACYSHIM_BIND $LEGACYSHIM_ARGS"
command_user="$LEGACYSHIM_USER:$LEGACYSHIM_USER"
depend() {
need net
use redis
use postgresql
use pgbouncer
}
start_pre() {
checkpath -f "$LOGS" -m 644 -o "$LEGACYSHIM_USER:$LEGACYSHIM_USER"
}