From 5663773f053a0cd9764e43b9f34b341f6df5853f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 14 Nov 2009 15:53:17 -0800 Subject: preserve user/group ownership when reopening logs This is only supported when SIGUSR1 is sent only to the master process (which then resends SIGUSR1 to the workers). Since we only added support for user/group switching in the workers, we now chown any log files upon switching users so the master can pick up and chown the log files later on. Thus we can avoid having to restart workers because they fail to rotate log files on their own. --- SIGNALS | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'SIGNALS') diff --git a/SIGNALS b/SIGNALS index 30a0ab0..5c7295e 100644 --- a/SIGNALS +++ b/SIGNALS @@ -50,6 +50,13 @@ automatically respawned. the current request, so multiple log lines for one request (as done by Rails) will not be split across multiple logs. + It is NOT recommended to send the USR1 signal directly to workers via + "killall -USR1 unicorn" if you are using user/group-switching support + in your workers. You will encounter incorrect file permissions and + workers will need to be respawned. Sending USR1 to the master process + first will ensure logs have the correct permissions before the master + forwards the USR1 signal to workers. + === Procedure to replace a running unicorn executable You may replace a running instance of unicorn with a new one without -- cgit v1.2.3-24-ge0c7