Ubuntu – way to force pid in upstart script

pythonUbuntuupstartuwsgi

I am running a uwsgi-python server under ubuntu 10.04. I use upstart to start/stop a uwsgi daemon(daemonize option is set for uwsgi).

Start and stop commands work fine, but when i try to reload my job, it won't work. The reason for this is that upstart associates wrong pid to my job, which is also a uwsgi process but not a master process. Master process is spawned third(two forks for daemonization) and upstart with expect daemon stanza expects second forked process to be the main.

So I was wondering is there a way to force upsart to associate my job with uwsgi master process ID or any other workaround with this issue?

Best Answer

do not daemonize under upstart, it is not needed