2020-12-13 05:13:30 +00:00
|
|
|
#!/usr/bin/with-contenv bash
|
|
|
|
|
|
|
|
UMASK_SET=${UMASK_SET:-022}
|
|
|
|
umask "$UMASK_SET"
|
|
|
|
|
|
|
|
cd /app || exit
|
|
|
|
|
2021-08-27 07:13:25 +00:00
|
|
|
PIDFILE=/run/app/gunicorn.pid
|
|
|
|
|
|
|
|
if [ -f "${PIDFILE}" ]
|
|
|
|
then
|
|
|
|
PID=$(cat $PIDFILE)
|
|
|
|
echo "Unexpected PID file exists at ${PIDFILE} with PID: ${PID}"
|
|
|
|
if kill -0 $PID
|
|
|
|
then
|
|
|
|
echo "Killing old gunicorn process with PID: ${PID}"
|
|
|
|
kill -9 $PID
|
|
|
|
fi
|
|
|
|
echo "Removing stale PID file: ${PIDFILE}"
|
|
|
|
rm ${PIDFILE}
|
|
|
|
fi
|
|
|
|
|
2020-12-13 05:13:30 +00:00
|
|
|
exec s6-setuidgid app \
|
|
|
|
/usr/local/bin/gunicorn -c /app/tubesync/gunicorn.py --capture-output tubesync.wsgi:application
|