about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-04-14 17:22:15 -0700
committerEric Wong <normalperson@yhbt.net>2009-04-14 17:22:15 -0700
commit966d55b875f714c9debe08a9b9d265204da2a845 (patch)
tree8fddb0822d7151dc335e7497c99165eadd375c73
parent8cd8de4637b5731b4d3ade587307d7241ce99eff (diff)
downloadunicorn-966d55b875f714c9debe08a9b9d265204da2a845.tar.gz
We don't (and won't ever) do log rotation within the process.
That's the job of logrotate and tools like that.  We just
reopen logs like other reasonable daemons out there.
-rw-r--r--lib/unicorn.rb8
-rw-r--r--test/exec/test_exec.rb12
2 files changed, 10 insertions, 10 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb
index 17159bf..3f15883 100644
--- a/lib/unicorn.rb
+++ b/lib/unicorn.rb
@@ -193,9 +193,9 @@ module Unicorn
             stop(false)
             break
           when :USR1 # rotate logs
-            logger.info "master rotating logs..."
+            logger.info "master reopening logs..."
             Unicorn::Util.reopen_logs
-            logger.info "master done rotating logs"
+            logger.info "master done reopening logs"
             kill_each_worker(:USR1)
           when :USR2 # exec binary, stay alive in case something went wrong
             reexec
@@ -467,9 +467,9 @@ module Unicorn
       while alive && @master_pid == Process.ppid
         if reopen_logs
           reopen_logs = false
-          @logger.info "worker=#{worker.nr} rotating logs..."
+          @logger.info "worker=#{worker.nr} reopening logs..."
           Unicorn::Util.reopen_logs
-          @logger.info "worker=#{worker.nr} done rotating logs"
+          @logger.info "worker=#{worker.nr} done reopening logs"
           wr.close rescue nil
           rd, wr = IO.pipe
           rd.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
diff --git a/test/exec/test_exec.rb b/test/exec/test_exec.rb
index 8780da0..888f7c7 100644
--- a/test/exec/test_exec.rb
+++ b/test/exec/test_exec.rb
@@ -370,21 +370,21 @@ end
     tries = DEFAULT_TRIES
     log = File.readlines(rotate.path)
     while (tries -= 1) > 0 &&
-          log.grep(/rotating logs\.\.\./).size < 5
+          log.grep(/reopening logs\.\.\./).size < 5
       sleep DEFAULT_RES
       log = File.readlines(rotate.path)
     end
-    assert_equal 5, log.grep(/rotating logs\.\.\./).size
-    assert_equal 0, log.grep(/done rotating logs/).size
+    assert_equal 5, log.grep(/reopening logs\.\.\./).size
+    assert_equal 0, log.grep(/done reopening logs/).size
 
     tries = DEFAULT_TRIES
     log = File.readlines(COMMON_TMP.path)
-    while (tries -= 1) > 0 && log.grep(/done rotating logs/).size < 5
+    while (tries -= 1) > 0 && log.grep(/done reopening logs/).size < 5
       sleep DEFAULT_RES
       log = File.readlines(COMMON_TMP.path)
     end
-    assert_equal 5, log.grep(/done rotating logs/).size
-    assert_equal 0, log.grep(/rotating logs\.\.\./).size
+    assert_equal 5, log.grep(/done reopening logs/).size
+    assert_equal 0, log.grep(/reopening logs\.\.\./).size
     assert_nothing_raised { Process.kill(:QUIT, pid) }
     status = nil
     assert_nothing_raised { pid, status = Process.waitpid2(pid) }