pkgsrc-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
rc.d script to start gunicorn
I have started to install taiga on a NetBSD host and I would like to
package it in the near future. I have written a rc.d script to start the
backend of this application which is installed in /srv/taiga/taiga-back.
The start command works correctly but the stop one fails with the
following message:
taiga is located in /usr/pkg/etc/rc.d
taiga not running? (check /var/run/taiga/gunicorn.log).
The pidfile contains the correct PID of the main gunicorn execution. But
when I check ps -o "pids,args" -A | grep taiga, I get something like:
2006 /srv/taiga/taiga-back/.venv/bin/python3.9
/srv/taiga/taiga-back/.venv/bin/gunicorn -D -p
/var/run/taiga/gunicorn.log -w 4 taiga.wsgi
5531 /srv/taiga/taiga-back/.venv/bin/python3.9
/srv/taiga/taiga-back/.venv/bin/gunicorn -D -p
/var/run/taiga/gunicorn.log -w 4 taiga.wsgi
9001 /srv/taiga/taiga-back/.venv/bin/python3.9
/srv/taiga/taiga-back/.venv/bin/gunicorn -D -p
/var/run/taiga/gunicorn.log -w 4 taiga.wsgi
17458 /srv/taiga/taiga-back/.venv/bin/python3.9
/srv/taiga/taiga-back/.venv/bin/gunicorn -D -p
/var/run/taiga/gunicorn.log -w 4 taiga.wsgi
18752 /srv/taiga/taiga-back/.venv/bin/python3.9
/srv/taiga/taiga-back/.venv/bin/gunicorn -D -p
/var/run/taiga/gunicorn.log -w 4 taiga.wsgi
I think the problem comes from the _find_processes function of
/etc/rc.subr since /srv/taiga/taiga-back/.venv/bin/python3.9 does not
match $command. Any idea on how handle this kind of daemon?
#!/bin/sh
#
# $NetBSD$
#
# PROVIDE: taiga
# REQUIRE: DAEMON
$_rc_subr_loaded . /etc/rc.subr
name="taiga"
pidfile="/var/run/taiga/gunicorn.log"
command="/srv/taiga/taiga-back/.venv/bin/gunicorn"
command_args="-D -p ${pidfile} -w 4 taiga.wsgi"
taiga_chdir="/srv/taiga/taiga-back"
taiga_env="PYTHONUNBUFFERED=true DJANGO_SETTINGS_MODULE=settings.config"
taiga_user="taiga"
run_rc_command "$1"
Home |
Main Index |
Thread Index |
Old Index