diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-03-21 13:14:33 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-03-21 13:38:25 -0700 |
commit | 46681f6ffd71b0902801f728f8911b02f3f09e1e (patch) | |
tree | 8917605a5f4c55fff56b516a060b31c2aaab852a /lib | |
parent | 90e68ef4d28615887e3a102e2233ceb46509f272 (diff) | |
download | unicorn-46681f6ffd71b0902801f728f8911b02f3f09e1e.tar.gz |
The master _may_ run with different user/group/umask than the workers. Since the logs were always created by the master process, the master should rotate them first to ensure correct ownership and permissions. This way if the workers fail log rotation and die, they'll be automatically respawned with the new logs in place.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/unicorn.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 9d40287..44d1b6d 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -179,8 +179,10 @@ module Unicorn stop(false) break when 'USR1' # rotate logs - kill_each_worker('USR1') + logger.info "master rotating logs..." Unicorn::Util.reopen_logs + logger.info "master done rotating logs" + kill_each_worker('USR1') when 'USR2' # exec binary, stay alive in case something went wrong reexec when 'WINCH' |