Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Fresh Ubuntu 12.04 instance running on Amazon EC2

got Nginx running with Passenger

added an upstart script

description "NGiNX starter"
start on (local-filesystems and runlevel [2345])
stop on runlevel [016]
respawn
exec /etc/nginx/sbin/nginx

the issue is that I have multiple nginx processing running (beyond worker threads)

$ ps aux | grep nginx
root       720  0.0  0.2  39624  1228 ?        Ss   03:23   0:00 nginx: master process /etc/nginx/sbin/nginx
www-data   722  0.0  0.3  40136  1884 ?        S    03:23   0:00 nginx: worker process
www-data   723  0.0  0.3  40136  1884 ?        S    03:23   0:00 nginx: worker process
www-data   724  0.0  0.3  40136  2388 ?        S    03:23   0:00 nginx: worker process
www-data   725  0.0  0.3  40136  1884 ?        S    03:23   0:00 nginx: worker process
www-data   726  0.0  0.3  40136  1884 ?        S    03:23   0:00 nginx: worker process
root      2218  0.0  0.6  39620  3688 ?        Ss   03:45   0:00 /etc/nginx/sbin/nginx

the way I read this is that process 720 has been started correctly and that processes 722,723,724,725,726 represent the worker threads configured in nginx.conf

what I don't get is what process 2218 is doing? when I try

sudo kill 2218

I get the message

kill: No such process

when I then check with ps aux | grep nginx again the rogue process will be running under a new PID

thinking that there is something going on with the upstart script since if I move it out of /etc/init reboot the instance and then run the same ps aux | grep nginx nothing is running

if I then boot nginx manually then the rogue thread does not appear

I've used this same script on another server for over a year without issue any ideas what I'm doing wrong?

share|improve this question
    
is init the parent of the "rogue thread"? –  Dmitri Chubarov May 4 '12 at 6:26
    
If you have pstree that will help you see the parents. –  pjmorse May 4 '12 at 16:15
    
pstree showed that both nginx threads are initiated by init -- the set with worker processes is all 1 process -- the rogue thread is separate –  Alvin May 4 '12 at 20:18
add comment

1 Answer

share|improve this answer
1  
Can you quote the links? Helps with link rot and doesn't look as LMGTFY –  TheLQ May 4 '12 at 16:14
    
going to try tinkering with expect daemon -- based on the documentation seems like that might be the issue –  Alvin May 4 '12 at 20:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.