Public bug reported:

lsb_release -rd: 
Description:    Ubuntu 20.04.1 LTS
Release:        20.04

apt-cache policy nginx-common:
nginx-common:
  Installed: 1.18.0-0ubuntu1
  Candidate: 1.18.0-0ubuntu1
  Version table:
 *** 1.18.0-0ubuntu1 500
        500 http://ap-northeast-1c.clouds.ports.ubuntu.com/ubuntu-ports 
focal-updates/main arm64 Packages
        100 /var/lib/dpkg/status
     1.17.10-0ubuntu1 500
        500 http://ap-northeast-1c.clouds.ports.ubuntu.com/ubuntu-ports 
focal/main arm64 Packages


In ubuntu 20.04, nginx use systemd to control status of nginx, the
following is part of the /lib/systemd/system/nginx.service

    # ExecStop sends SIGSTOP (graceful stop) to the nginx process.
    # If, after 5s (--retry QUIT/5) nginx is still running, systemd takes 
control
    # and sends SIGTERM (fast shutdown) to the main process.
    # After another 5s (TimeoutStopSec=5), and if nginx is alive, systemd sends
    # SIGKILL to all the remaining processes in the process group 
(KillMode=mixed).

    [Service]
    Type=forking
    PIDFile=/run/nginx.pid
    ExecStartPre=/usr/sbin/nginx -t -q -g 'daemon on; master_process on;'
    ExecStart=/usr/sbin/nginx -g 'daemon on; master_process on;'
    ExecReload=/usr/sbin/nginx -g 'daemon on; master_process on;' -s reload
    ExecStop=-/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile 
/run/nginx.pid
    TimeoutStopSec=5

As comment said, execstop will send SIGSTOP, and SIGTERM after 5 seconds
if process don't stop, but actually the command below use SIGQUIT
instead of SIGSTOP to gracefully shutdown the process.

then I looked for the nginx documentation
​http://nginx.org/en/docs/control.html , nginx receive QUIT instead of
STOP.

also, refrring to the linux signal(7) ​https://man7.org/linux/man-
pages/man7/signal.7.html

The signals SIGKILL and SIGSTOP cannot be caught, blocked, or ignored.

nginx shouldn't be able to capture SIGSTOP and take time to gracefully
shutdown, SIGQUIT can

the comments above should change to

ExecStop sends SIGQUIT (graceful stop) to the nginx process.

If there's anything I missed it, pls let me know, thanks

** Affects: nginx (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1919965

Title:
  nginx-common nginx.service comments use wrong signal

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1919965/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to