Giter VIP home page Giter VIP logo

Comments (4)

GUI avatar GUI commented on August 30, 2024

If nginx -s stop is still working, then I'm wondering if this issue is related to the script you're using to start and stop nginx as a service (although it's still odd that this init() is making a difference). So what type of service script are you using? Do you have an init.d script, or are you using upstart, or something else? Could you share the contents of that script?

And are there any errors being logged to your nginx error log file on either startup or shutdown?

Since it seems like the service script is getting hung up on shutdown, one other potential thing to debug is to see if any child processes are being left around. If you're using something like upstart, I'm wondering if the sockproc process might be left running, which might be confusing the shutdown script if it's paying attention to process groups. One way to potentially debug this is to use pstree to see what processes are running as a child to nginx. So after starting nginx, you could try running pstree -a -p and find the nginx processes in this output. Then after attempting to stop nginx, try running that same command again and see if there's still any processes hanging around under nginx's parent process.

from lua-resty-auto-ssl.

communiteq avatar communiteq commented on August 30, 2024

We're using upstart. Yes, it definitely has to do with the startup script, but it definitely has to do with auto_ssl:init() as well... those two are just not playing nicely together.

Here is /etc/init/nginx.conf

description "nginx - small, powerful, scalable web/proxy server"

start on filesystem and static-network-up
stop on runlevel [016]

expect fork
respawn

pre-start script
        [ -x /usr/sbin/nginx ] || { stop; exit 0; }
        /usr/sbin/nginx -q -t -g 'daemon on; master_process on;' || { stop; exit 0; }
end script

exec /usr/sbin/nginx -g 'daemon on; master_process on;'

pre-stop exec /usr/sbin/nginx -s quit

No errors in any logs. Yes, after some web searching I'm totally suspecting sockproc as well, but I don't even see it running.

 1578 ?        Ss     0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
 1579 ?        S      0:00  \_ nginx: worker process                           
 1580 ?        S      0:00  \_ nginx: worker process                           
 1581 ?        S      0:00  \_ nginx: worker process                           
 1582 ?        S      0:00  \_ nginx: worker process                           
 1583 ?        S      0:00  \_ nginx: cache manager process  

Problem is: nothing seems to be stuck. After stopping they're all gone...

from lua-resty-auto-ssl.

communiteq avatar communiteq commented on August 30, 2024

Update: somehow removing expect fork solves this issue.

from lua-resty-auto-ssl.

GUI avatar GUI commented on August 30, 2024

@discoursehosting: Sorry for the belated followup, but thank you very much for the sleuthing! Very interesting. I'm not super-familiar with upstart, but it definitely seems like us starting sockproc inside nginx is somehow interfering with how Upstart tracks forked processes. I'm glad you were able to find the workaround with removing expect fork, but I'll have to play around with Upstart at some point to see if there's a cleaner way we could be handling this.

from lua-resty-auto-ssl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.