Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

managing uWSGI with Upstart

I am trying to configure uWSGI with Upstart.

I created the file /etc/init/uwsgi-flask.conf:

description "uwsgi for flask"
start on runlevel [2345]
stop on runlevel [06]
exec /appdir/virtualenvdir/bin/uwsgi /appdir/virtualenvdir/uwsgi.ini --die-on-term

On reboot, it starts up correctly, but I am not able to stop the service.

If I type on shell initctl stop uwsgi-flask, it gives:

initctl: Unknown instance:

anyone has any idea?

like image 788
Daniele B Avatar asked Jul 16 '13 02:07

Daniele B


1 Answers

You probably have daemonize=some/log/file/path in your ini file. That will make the process exit with a "normal" exit code, so Upstart will figure that you wanted the job stopped and terminate the job.

Remove daemonize and upstart will track the process in the foreground.

like image 120
SpamapS Avatar answered Oct 30 '22 11:10

SpamapS