kill -USR2 apparently not working
June 04, 2014 04:47PM
Hey All,

I'm running on Ubuntu 12.04 and nginx 1.5.12 compiled from source. I'm attempting to upgrade nginx to 1.6.0 on my production servers without incurring any downtime. Ideally, I'd like to:

1) Replace the binary
2) send the master PID a kill -USR2 (kill -USR2 `cat /usr/local/nginx/logs/nginx.pid`)
3) WINCH the old master PID (kill -WINCH `cat /usr/local/nginx/logs/nginx.pid.oldbin`)

Recompiling from source works great. However, when I send the USR2 to the current master PID nothing seems to happen. The process list (`ps aux | grep nginx | grep -v grep`) does not change at all; I would expect to see a new master PID. I am also not seeing a nginx.pid.oldbin file in /usr/local/nginx/logs. I've tried sending both a USR2 and INT (even though they are apparently the same signal). I don't believe `kill` has verbose output or any way to tell me what is actually happening when I send the signal. My next step is to attach to the process with strace to see what syscalls get made when I send USR2 but am not entirely sure how far that will really get me.

I've posted this question in the IRC channel to no avail thus far, so hopefully someone on the forums will be able to assist!

Thanks for reading!

Jaryd
Re: kill -USR2 apparently not working
June 04, 2014 06:05PM
After attaching to the process I saw that the PID was writing to the error log after I sent the USR2 signal (d'oh! should have checked there!). In the error log I have the following lines (one for each time I attempted to send `kill -USR2` to the master PID):

2014/06/04 15:45:04 [crit] 1018#0: the changing binary signal is ignored: you should shutdown or terminate before either old or new binary's process



Edited 1 time(s). Last edit at 06/04/2014 06:05PM by jaryd.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 202
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready