ayaports/user/tandoor-recipes/recipes.openrc

36 lines
850 B
Text

#!/sbin/openrc-run
name="$RC_SVCNAME"
cfgfile="/etc/conf.d/$RC_SVCNAME.conf"
pidfile="/run/recipes/$RC_SVCNAME.pid"
working_directory="/usr/share/webapps/recipes"
command="/usr/bin/gunicorn"
command_args="
--error-logfile /var/log/recipes/gunicorn_err.log
--log-level debug
--capture-output
--bind unix:/run/recipes/recipes.sock
recipes.wsgi:application
"
command_user="recipes"
command_group="www-data"
start_stop_daemon_args=""
command_background="yes"
depend() {
need postgresql
need nginx
}
start_pre() {
cd "$working_directory"
checkpath --directory --owner $command_user:$command_group --mode 0775 \
/var/log/recipes \
/run/recipes \
/var/lib/recipes/media
}
stop_pre() {
ebegin "Killing child processes"
kill $(ps -o pid= --ppid $(cat $pidfile)) || true
}