Il giorno 20/set/2010, alle ore 15.20, Jean-Baptiste Quenot ha scritto:

> Hi there,
> 
> Since I switched to TCP sockets on my uwsgi installation I noticed
> some strange things in the netstat output. Let's say we have uwsgi
> running, with --pidfile /var/run/app.pid -s 127.0.0.1:25555.  If
> /var/run/app.pid contains a PID like 26712 I would expect to find a
> netstat entry like this:
> 
> tcp        0      0 127.0.0.1:25555         0.0.0.0:*
> LISTEN      26712/uwsgi
> 
> However after some days running uwsgi with probably some harakiri
> going on, I found this:
> 
> tcp        0      0 127.0.0.1:25555         0.0.0.0:*
> LISTEN      609/sh
> 
> Note that the PID is wrong, and the command as well.  I looked at this
> process and found:
> 
> 1003       609  0.0  0.0   4024   584 ?        S    Sep17   0:00
> /bin/sh -c apachesyslog
> 
> Actually this is one of the subprocesses that are spawned from my
> uwsgi workers.



How do you spawn subprocesses ? Remember to close all the fds if you do not want
them to be inherited.

There is a special ioctl/fcntl for fd (close-on-exec) 

http://www.manpagez.com/man/2/fcntl/

it is good for some cases, but if you have long-running (detached) processes
you should always close all the useless descriptor.

--
Roberto De Ioris
http://unbit.it
JID: [email protected]

_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to