Hi folks,
I've created this rc script to start gunicorn as a daemon on boot following this article (practical rc scripting).
It's working in a sense that after booting, the service is up. But the problem I'm facing is when trying stop/restart the service.
So, gunicorn is running and the pidfile is where it asked me. Is there anything I'm missing?
Thanks
I've created this rc script to start gunicorn as a daemon on boot following this article (practical rc scripting).
Bash:
#!/bin/sh
# PROVIDE: gunicorn_appleclue
# REQUIRE: DAEMON
. /etc/rc.subr
name=gunicorn_appleclue
rcvar=gunicorn_appleclue_enable
pidfile="/var/run/gunicorn/${name}.pid"
command="/usr/sbin/daemon"
command_args="-p ${pidfile} -r -t django_appleclue /home/victor/.venv/appleclue/bin/gunicorn -b 0.0.0.0:8001 -w 4 --pythonpath /home/victor/applications/appleclue/appleclue-web appleclue.wsgi"
load_rc_config $name
run_rc_command "$1"
It's working in a sense that after booting, the service is up. But the problem I'm facing is when trying stop/restart the service.
Code:
sudo service gunicorn_appleclue stop
gunicorn_appleclue not running? (check /var/run/gunicorn/gunicorn_appleclue.pid).
ls -la /var/run/gunicorn/gunicorn_appleclue.pid
-rw------- 1 root wheel 3 May 15 14:25 /var/run/gunicorn/gunicorn_appleclue.pid
So, gunicorn is running and the pidfile is where it asked me. Is there anything I'm missing?
Thanks