[Supervisor-users] Supervisord and Nginx configuration
Chris McDonough
chrism at plope.com
Sun Dec 13 21:45:38 EST 2009
"sudo kill -INT `cat /var/run/nginx.pid`" is not how you start nginx actually.
That's how you might *restart* an already running nginx (at least one which
isn't managed by supervisor), but since it's not running yet, it's not relevant.
I don't know the magic command to make this work because I've never used nginx,
but in general, you need to get nginx to run:
- in the foreground
- as the same user as the person (or process) which started supervisor
- OR -
- as the user implied by "user = someuser" (someuser)
Getting ngnix to run in the foreground is apparently accomplished by setting
"daemon off" in the nginx config file, at least according to
http://www.ruby-forum.com/topic/152245 .
Making sure it's running as "the right" user is another issue. This depends
entirely on your setup.
Mark Jarecki wrote:
> Hi there,
>
> just another question. How do I configure the supervisord.conf file to enable the control of Nginx?
>
> Killing Nginx is typically:
> sudo kill -INT `cat /var/run/nginx.pid`
>
> The Nginx section in my supervisord.conf is:
>
> [program:nginx]
> command=sudo /usr/local/sbin/nginx
> stopsignal=INT
> user=someuser
>
> This does nothing but generate errors when I run:
>
> sudo supervisorctl stop nginx
>
> The error:
> FAILED: unknown problem killing nginx (163):Traceback (most recent call last):
> File "/usr/local/lib/python2.6/site-packages/supervisor-3.0a7-py2.6.egg/supervisor/process.py", line 383, in kill
> options.kill(self.pid, sig)
> File "/usr/local/lib/python2.6/site-packages/supervisor-3.0a7-py2.6.egg/supervisor/options.py", line 1064, in kill
> os.kill(pid, signal)
> OSError: [Errno 1] Operation not permitted
>
> Then when i run sudo supervisorctl status, I get:
>
> nginx UNKNOWN
>
> If anyone could point me in the right direction, that would be greatly appreciated.
>
> Cheers,
>
> Mark
> _______________________________________________
> Supervisor-users mailing list
> Supervisor-users at lists.supervisord.org
> http://lists.supervisord.org/mailman/listinfo/supervisor-users
>
More information about the Supervisor-users
mailing list