From normalperson at yhbt.net Fri Apr 1 19:15:01 2011 From: normalperson at yhbt.net (Eric Wong) Date: Fri, 1 Apr 2011 16:15:01 -0700 Subject: Reopening logs - why no relative paths? In-Reply-To: <20110331220248.GA1826@dcvr.yhbt.net> References: <20110331220248.GA1826@dcvr.yhbt.net> Message-ID: <20110401231501.GA31711@dcvr.yhbt.net> Eric Wong wrote: > Matthew Kocher wrote: > > We just spend a couple hours trying to figure out why sending a USR1 > > signal wasn't causing unicorn to reopen logs. Looking at the source > > reveals that only files opened with absolute paths are eligible for > > rotation, the others are silently skipped. > > > > We use the fairly standard practice of always logging to > > log/unicorn.error.log and creating symlinks to where we'd like the > > logs to live on individual hosts. We'll change our configs for the > > time being, but is there a reason to not reopen the relative paths? > > It's ambiguous due to directory changes[1]. It may be easier now that > we have the "working_directory" directive now, but configuration changes > also change (or unset) the "working_directory" which adds to the > confusion. > > We could try allowing it and see what happens, I suppose... Just pushed this out, thinking about it more I don't think it'll have an adverse effect on most installations out there... >From 6647dcb3afa4c0b16c5fef5bfdf88292e6adf6ca Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 1 Apr 2011 16:09:03 -0700 Subject: [PATCH] util: allow relative paths to be rotated Users keep both pieces if it's broken :) --- lib/unicorn/util.rb | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/unicorn/util.rb b/lib/unicorn/util.rb index 82329eb..cde2563 100644 --- a/lib/unicorn/util.rb +++ b/lib/unicorn/util.rb @@ -8,7 +8,6 @@ module Unicorn::Util ! fp.closed? && fp.sync && - fp.path[0] == ?/ && (fp.fcntl(Fcntl::F_GETFL) & append_flags) == append_flags rescue IOError, Errno::EBADF false @@ -25,10 +24,12 @@ module Unicorn::Util # using logrotate(8) (without copytruncate) or similar tools. # A +File+ object is considered for reopening if it is: # 1) opened with the O_APPEND and O_WRONLY flags - # 2) opened with an absolute path (starts with "/") - # 3) the current open file handle does not match its original open path - # 4) unbuffered (as far as userspace buffering goes, not O_SYNC) + # 2) the current open file handle does not match its original open path + # 3) unbuffered (as far as userspace buffering goes, not O_SYNC) # Returns the number of files reopened + # + # In Unicorn 3.5.x and earlier, files must be opened with an absolute + # path to be considered a log file. def self.reopen_logs to_reopen = [] nr = 0 -- Eric Wong From ernestorrocha at gmail.com Thu Apr 7 17:11:56 2011 From: ernestorrocha at gmail.com (Ernesto Rocha) Date: Thu, 7 Apr 2011 21:11:56 +0000 (UTC) Subject: Unicorn error Message-ID: Hi guys, These days I'm experimenting a strange behavior from Unicorn. Now the issue is, when I try to access a page it's always times out, so, on browser I see: Nginx - "bad gateway - timed out" page error When i start unicorn with -d parameter I only see: {:daemonize=>false, :app=> #, :unicorn_options=> {:config_file=>"/home/user/project/current/config/unicorn.rb", :listeners=>[]}} Exception `Errno::EEXIST' at /usr/local/rvm/rubies/ruby-1.8.7- p302/lib/ruby/1.8/fileutils.rb:243 - File exists - tmp/cache Exception `Errno::EEXIST' at /usr/local/rvm/rubies/ruby-1.8.7- p302/lib/ruby/1.8/fileutils.rb:243 - File exists - tmp/pids Exception `Errno::EEXIST' at /usr/local/rvm/rubies/ruby-1.8.7- p302/lib/ruby/1.8/fileutils.rb:243 - File exists - tmp/sessions Exception `Errno::EEXIST' at /usr/local/rvm/rubies/ruby-1.8.7- p302/lib/ruby/1.8/fileutils.rb:243 - File exists - tmp/sockets And at unicorn.stderr.log which is about 2gb now with these lines repeated over and over again: worker=0 spawning... worker=1 spawning... worker=0 spawned pid=30557 /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- 3.5.0/lib/unicorn/util.rb:19:in `chown': Operation not permitted - /home/user/project/shared/log/unicorn.stderr.log (Errno::EPERM) from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- 3.5.0/lib/unicorn/util.rb:19:in `chown_logs' from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- 3.5.0/lib/unicorn/util.rb:18:in `each_object' from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- 3.5.0/lib/unicorn/util.rb:18:in `chown_logs' from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- 3.5.0/lib/unicorn/worker.rb:31:in `user' from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- 3.5.0/lib/unicorn/http_server.rb:561:in `init_worker_process' from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- 3.5.0/lib/unicorn/http_server.rb:578:in `worker_loop' from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- 3.5.0/lib/unicorn/http_server.rb:495:in `spawn_missing_workers' from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- 3.5.0/lib/unicorn/http_server.rb:492:in `fork' from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- 3.5.0/lib/unicorn/http_server.rb:492:in `spawn_missing_workers' from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- 3.5.0/lib/unicorn/http_server.rb:488:in `each' from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- 3.5.0/lib/unicorn/http_server.rb:488:in `spawn_missing_workers' from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- 3.5.0/lib/unicorn/http_server.rb:502:in `maintain_worker_count' from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- 3.5.0/lib/unicorn/http_server.rb:161:in `start' from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- 3.5.0/lib/unicorn.rb:13:in `run' from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- 3.5.0/bin/unicorn_rails:208 from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/bin/unicorn_rails:19:in `load' from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/bin/unicorn_rails:19 master process ready worker=1 spawned pid=30558 /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- 3.5.0/lib/unicorn/util.rb:19:in `chown': Operation not permitted - /home/user/project/shared/log/unicorn.stderr.log (Errno::EPERM) .... and on.... $ rails -v Rails 3.0.6 Using rack (1.2.2) $unicorn -v unicorn v3.5.0 Ubuntu 10.10 $ nginx -v nginx version: nginx/0.7.67 I don't know what more information you may need. But, that's it. I don't have any idea to fix this. Any thought ? Thansk, Ernesto From cliftonk at gmail.com Thu Apr 7 18:04:26 2011 From: cliftonk at gmail.com (Clifton King) Date: Thu, 7 Apr 2011 17:04:26 -0500 Subject: Unicorn error In-Reply-To: References: Message-ID: Are permissions set correctly in all of your application folders? /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- 3.5.0/lib/unicorn/util.rb:19:in `chown': Operation not permitted - /home/user/project/shared/log/unicorn.stderr.log (Errno::EPERM) from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- Looks to me you may need to do a chown -r app_user /app_directory/ where app_user is the user unicorn is running on. Does unicorn work with sudo? On Thu, Apr 7, 2011 at 4:11 PM, Ernesto Rocha wrote: > > Hi guys, > > These days I'm experimenting a strange behavior from Unicorn. Now the issue is, > when I try to access a page it's always times out, so, on browser I see: > > Nginx - "bad gateway - timed out" page error > > When i start unicorn with -d parameter I only see: > > > {:daemonize=>false, > ?:app=> > ?# p302 at project/gems/unicorn-3.5.0/bin/unicorn_rails:135>, > ?:unicorn_options=> > ?{:config_file=>"/home/user/project/current/config/unicorn.rb", > ? :listeners=>[]}} > Exception `Errno::EEXIST' at /usr/local/rvm/rubies/ruby-1.8.7- > p302/lib/ruby/1.8/fileutils.rb:243 - File exists - tmp/cache > Exception `Errno::EEXIST' at /usr/local/rvm/rubies/ruby-1.8.7- > p302/lib/ruby/1.8/fileutils.rb:243 - File exists - tmp/pids > Exception `Errno::EEXIST' at /usr/local/rvm/rubies/ruby-1.8.7- > p302/lib/ruby/1.8/fileutils.rb:243 - File exists - tmp/sessions > Exception `Errno::EEXIST' at /usr/local/rvm/rubies/ruby-1.8.7- > p302/lib/ruby/1.8/fileutils.rb:243 - File exists - tmp/sockets > > > And at unicorn.stderr.log which is about 2gb now with these lines repeated over > and over again: > > worker=0 spawning... > worker=1 spawning... > worker=0 spawned pid=30557 > /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- > 3.5.0/lib/unicorn/util.rb:19:in `chown': Operation not permitted - > /home/user/project/shared/log/unicorn.stderr.log (Errno::EPERM) > ? ? ? ?from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- > 3.5.0/lib/unicorn/util.rb:19:in `chown_logs' > ? ? ? ?from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- > 3.5.0/lib/unicorn/util.rb:18:in `each_object' > ? ? ? ?from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- > 3.5.0/lib/unicorn/util.rb:18:in `chown_logs' > ? ? ? ?from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- > 3.5.0/lib/unicorn/worker.rb:31:in `user' > ? ? ? ?from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- > 3.5.0/lib/unicorn/http_server.rb:561:in `init_worker_process' > ? ? ? ?from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- > 3.5.0/lib/unicorn/http_server.rb:578:in `worker_loop' > ? ? ? ?from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- > 3.5.0/lib/unicorn/http_server.rb:495:in `spawn_missing_workers' > ? ? ? ?from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- > 3.5.0/lib/unicorn/http_server.rb:492:in `fork' > ? ? ? ?from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- > 3.5.0/lib/unicorn/http_server.rb:492:in `spawn_missing_workers' > ? ? ? ?from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- > 3.5.0/lib/unicorn/http_server.rb:488:in `each' > ? ? ? ?from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- > 3.5.0/lib/unicorn/http_server.rb:488:in `spawn_missing_workers' > ? ? ? ?from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- > 3.5.0/lib/unicorn/http_server.rb:502:in `maintain_worker_count' > ? ? ? ?from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- > 3.5.0/lib/unicorn/http_server.rb:161:in `start' > ? ? ? ?from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- > 3.5.0/lib/unicorn.rb:13:in `run' > ? ? ? ?from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- > 3.5.0/bin/unicorn_rails:208 > ? ? ? ?from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/bin/unicorn_rails:19:in > `load' > ? ? ? ?from /usr/local/rvm/gems/ruby-1.8.7-p302 at project/bin/unicorn_rails:19 > master process ready > worker=1 spawned pid=30558 > /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- > 3.5.0/lib/unicorn/util.rb:19:in `chown': Operation not permitted - > /home/user/project/shared/log/unicorn.stderr.log (Errno::EPERM) > .... and on.... > > $ rails -v > Rails 3.0.6 > > Using rack (1.2.2) > > $unicorn -v > unicorn v3.5.0 > > Ubuntu 10.10 > > $ nginx -v > nginx version: nginx/0.7.67 > > I don't know what more information you may need. But, that's it. I don't have > any idea to fix this. Any thought ? > > Thansk, > Ernesto > > _______________________________________________ > Unicorn mailing list - mongrel-unicorn at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-unicorn > Do not quote signatures (like this one) or top post when replying > From normalperson at yhbt.net Thu Apr 7 18:58:44 2011 From: normalperson at yhbt.net (Eric Wong) Date: Thu, 7 Apr 2011 22:58:44 +0000 Subject: Unicorn error In-Reply-To: References: Message-ID: <20110407225844.GA28851@dcvr.yhbt.net> Ernesto Rocha wrote: > /usr/local/rvm/gems/ruby-1.8.7-p302 at project/gems/unicorn- > 3.5.0/lib/unicorn/util.rb:19:in `chown': Operation not permitted - > /home/user/project/shared/log/unicorn.stderr.log (Errno::EPERM) > .... and on.... It looks like you're trying to use the "user" directive to switch users when you're not running as root[1]. Don't use "user" if you're already a regular user. [1] or use something like Linux capabilities(7) and lack the appropriate ones. http://linux.die.net/man/7/capabilities -- Eric Wong From emmanuel.gomez at gmail.com Tue Apr 12 12:13:02 2011 From: emmanuel.gomez at gmail.com (Emmanuel Gomez) Date: Tue, 12 Apr 2011 09:13:02 -0700 Subject: Struggling with logrotate and unicorn Message-ID: <8A1F87B7-F4A6-4186-AE22-604F875C7F29@gmail.com> Hi, First of all, thanks for Unicorn, it's a fantastic tool. I'm starting a Unicorn 3.3.1 master process as root on an Ubuntu 10.04 LTS host, and dropping to an unprivileged user in the workers after forking. This all works fine. I have confirmed that logrotate creates the logs with a 0600 umask and the uid/gid of my unprivileged user (per my logrotate config, loosely based on the example logrotate.conf from 3.4 or 3.5). The problem occurs when I send a USR1 signal to the master process (as root, because the master is running as root) after the logs have been rotated. As near as I can tell, after that the Unicorn master chowns the logs to root ownership. Then, the workers attempt to chown the logs back to ownership by the unprivileged user, which repeatedly fails, spewing megabytes of errors that look like: worker=0 reopening logs... Unhandled listen loop exception #. /opt/wp/src/nascar/shared/bundle/ruby/1.8/gems/unicorn-3.3.1/lib/unicorn/util.rb:57:in `chown' /opt/wp/src/nascar/shared/bundle/ruby/1.8/gems/unicorn-3.3.1/lib/unicorn/util.rb:57:in `reopen_logs' /opt/wp/src/nascar/shared/bundle/ruby/1.8/gems/unicorn-3.3.1/lib/unicorn/util.rb:37:in `each' /opt/wp/src/nascar/shared/bundle/ruby/1.8/gems/unicorn-3.3.1/lib/unicorn/util.rb:37:in `reopen_logs' /opt/wp/src/nascar/shared/bundle/ruby/1.8/gems/unicorn-3.3.1/lib/unicorn/http_server.rb:569:in `reopen_worker_logs' /opt/wp/src/nascar/shared/bundle/ruby/1.8/gems/unicorn-3.3.1/lib/unicorn/http_server.rb:592:in `worker_loop' /opt/wp/src/nascar/shared/bundle/ruby/1.8/gems/unicorn-3.3.1/lib/unicorn/http_server.rb:496:in `spawn_missing_workers' /opt/wp/src/nascar/shared/bundle/ruby/1.8/gems/unicorn-3.3.1/lib/unicorn/http_server.rb:493:in `fork' /opt/wp/src/nascar/shared/bundle/ruby/1.8/gems/unicorn-3.3.1/lib/unicorn/http_server.rb:493:in `spawn_missing_workers' /opt/wp/src/nascar/shared/bundle/ruby/1.8/gems/unicorn-3.3.1/lib/unicorn/http_server.rb:489:in `each' /opt/wp/src/nascar/shared/bundle/ruby/1.8/gems/unicorn-3.3.1/lib/unicorn/http_server.rb:489:in `spawn_missing_workers' /opt/wp/src/nascar/shared/bundle/ruby/1.8/gems/unicorn-3.3.1/lib/unicorn/http_server.rb:503:in `maintain_worker_count' /opt/wp/src/nascar/shared/bundle/ruby/1.8/gems/unicorn-3.3.1/lib/unicorn/http_server.rb:297:in `join' /opt/wp/src/nascar/shared/bundle/ruby/1.8/gems/unicorn-3.3.1/lib/unicorn.rb:13:in `run' /opt/wp/src/nascar/shared/bundle/ruby/1.8/gems/unicorn-3.3.1/bin/unicorn_rails:208 /opt/wp/src/nascar/shared/bundle/ruby/1.8/bin/unicorn_rails:19:in `load' /opt/wp/src/nascar/shared/bundle/ruby/1.8/bin/unicorn_rails:19 I looked at Unicorn::Util.reopen_logs, which is where the exception originates, and clearly has code intended to deal with this (https://github.com/defunkt/unicorn/blob/v3.3.1/lib/unicorn/util.rb#L56), but it doesn't appear to be doing the right thing in my circumstance. It's not apparent to me at a glance why this is failing. I'm not subscribed to the list, so please cc: my on replies. Thanks for any input you may have, Emmanuel Gomez From normalperson at yhbt.net Tue Apr 12 13:58:55 2011 From: normalperson at yhbt.net (Eric Wong) Date: Tue, 12 Apr 2011 17:58:55 +0000 Subject: Struggling with logrotate and unicorn In-Reply-To: <8A1F87B7-F4A6-4186-AE22-604F875C7F29@gmail.com> References: <8A1F87B7-F4A6-4186-AE22-604F875C7F29@gmail.com> Message-ID: <20110412175855.GA21250@dcvr.yhbt.net> Emmanuel Gomez wrote: > I have confirmed that logrotate creates the logs with a 0600 umask and > the uid/gid of my unprivileged user (per my logrotate config, loosely > based on the example logrotate.conf from 3.4 or 3.5). Did the permissions of the old (rotated) log files change? > The problem occurs when I send a USR1 signal to the master process (as > root, because the master is running as root) after the logs have been > rotated. As near as I can tell, after that the Unicorn master chowns > the logs to root ownership. Then, the workers attempt to chown the > logs back to ownership by the unprivileged user, which repeatedly > fails, spewing megabytes of errors that look like: The rotation error handling should probably just exit! the worker and rely on the master to restart it... -- Eric Wong From emmanuel.gomez at gmail.com Tue Apr 12 14:36:38 2011 From: emmanuel.gomez at gmail.com (Emmanuel Gomez) Date: Tue, 12 Apr 2011 11:36:38 -0700 Subject: Struggling with logrotate and unicorn In-Reply-To: <20110412175855.GA21250@dcvr.yhbt.net> References: <8A1F87B7-F4A6-4186-AE22-604F875C7F29@gmail.com> <20110412175855.GA21250@dcvr.yhbt.net> Message-ID: <91269EF1-4FEC-4CD3-82EE-4DF48F2544EE@gmail.com> On Apr 12, 2011, at 10:58 AM, Eric Wong wrote: > Emmanuel Gomez wrote: >> I have confirmed that logrotate creates the logs with a 0600 umask and >> the uid/gid of my unprivileged user (per my logrotate config, loosely >> based on the example logrotate.conf from 3.4 or 3.5). > > Did the permissions of the old (rotated) log files change? No, they remained owned by root. >> The problem occurs when I send a USR1 signal to the master process (as >> root, because the master is running as root) after the logs have been >> rotated. As near as I can tell, after that the Unicorn master chowns >> the logs to root ownership. Then, the workers attempt to chown the >> logs back to ownership by the unprivileged user, which repeatedly >> fails, spewing megabytes of errors that look like: > > The rotation error handling should probably just exit! the worker > and rely on the master to restart it... That would probably be better behavior, although in this specific case the worker would immediately die on respawn because the log is still owned by root and unwriteable by my unprivileged user. I did find a resolution: in the after_fork block, I had copied the code to switch users from the GitHub blog post on unicorn (https://github.com/blog/517-unicorn). I didn't see Unicorn::Worker#user, which implements the same code with the addition of a call to Unicorn::Util.chown_logs. When I replace the inline GitHub-blog-derived code with a call to Unicorn::Worker#user, it works. My understanding is that this (after_fork/Unicorn::Util.chown_logs) shouldn't be executed on USR1; I don't see how the Unicorn::Util.chown_logs call on after_fork (startup) would make a difference w/r/t rotation (much later), but my understanding is obviously incomplete, because it works. Thanks for your reply, I'm off to comment on the GitHub blog post to try to warn others to use Unicorn::Worker#user instead of the example code in after_fork. -- Emmanuel From normalperson at yhbt.net Tue Apr 12 14:59:02 2011 From: normalperson at yhbt.net (Eric Wong) Date: Tue, 12 Apr 2011 11:59:02 -0700 Subject: Struggling with logrotate and unicorn In-Reply-To: <91269EF1-4FEC-4CD3-82EE-4DF48F2544EE@gmail.com> References: <8A1F87B7-F4A6-4186-AE22-604F875C7F29@gmail.com> <20110412175855.GA21250@dcvr.yhbt.net> <91269EF1-4FEC-4CD3-82EE-4DF48F2544EE@gmail.com> Message-ID: <20110412185901.GA32009@dcvr.yhbt.net> Emmanuel Gomez wrote: > On Apr 12, 2011, at 10:58 AM, Eric Wong wrote: > > Emmanuel Gomez wrote: > >> I have confirmed that logrotate creates the logs with a 0600 umask > >> and the uid/gid of my unprivileged user (per my logrotate config, > >> loosely based on the example logrotate.conf from 3.4 or 3.5). > > > > Did the permissions of the old (rotated) log files change? > > No, they remained owned by root. Remained owned by root? Yes that sounds like the problem. > >> The problem occurs when I send a USR1 signal to the master process > >> (as root, because the master is running as root) after the logs > >> have been rotated. As near as I can tell, after that the Unicorn > >> master chowns the logs to root ownership. Then, the workers attempt > >> to chown the logs back to ownership by the unprivileged user, which > >> repeatedly fails, spewing megabytes of errors that look like: > > > > The rotation error handling should probably just exit! the worker > > and rely on the master to restart it... > > That would probably be better behavior, although in this specific case > the worker would immediately die on respawn because the log is still > owned by root and unwriteable by my unprivileged user. > > I did find a resolution: in the after_fork block, I had copied the > code to switch users from the GitHub blog post on unicorn > (https://github.com/blog/517-unicorn). I didn't see > Unicorn::Worker#user, which implements the same code with the addition > of a call to Unicorn::Util.chown_logs. When I replace the inline > GitHub-blog-derived code with a call to Unicorn::Worker#user, it > works. Yes, the old versions of Unicorn didn't change users at all. I always knew user-switching is a pain in the ass to deal with due to issues like this. Due to work on Rainbows! (designed to run on port 80) and users starting as root anyways (due to init scripts), I needed add this feature. > My understanding is that this (after_fork/Unicorn::Util.chown_logs) > shouldn't be executed on USR1; I don't see how the > Unicorn::Util.chown_logs call on after_fork (startup) would make a > difference w/r/t rotation (much later), but my understanding is > obviously incomplete, because it works. It's the rotation that attempts to chown since it thinks (incorrectly) that it's in the master process. I'll make that more robust and release 3.6.0 sometime this week with (hopefully) a few other minor improvements. > Thanks for your reply, I'm off to comment on the GitHub blog post to > try to warn others to use Unicorn::Worker#user instead of the example > code in after_fork. Thanks, that seems to be a general problem with people relying on blog/mailing list posts instead of consistently updated documentation. -- Eric Wong From emmanuel.gomez at gmail.com Tue Apr 12 18:38:32 2011 From: emmanuel.gomez at gmail.com (Emmanuel Gomez) Date: Tue, 12 Apr 2011 15:38:32 -0700 Subject: Struggling with logrotate and unicorn In-Reply-To: <20110412185901.GA32009@dcvr.yhbt.net> References: <8A1F87B7-F4A6-4186-AE22-604F875C7F29@gmail.com> <20110412175855.GA21250@dcvr.yhbt.net> <91269EF1-4FEC-4CD3-82EE-4DF48F2544EE@gmail.com> <20110412185901.GA32009@dcvr.yhbt.net> Message-ID: On Apr 12, 2011, at 11:59 AM, Eric Wong wrote: > I'll make that more robust and release > 3.6.0 sometime this week with (hopefully) a few other minor > improvements. Great. This is apparently an infrequent circumstance (uncommon configuration?), but there will be a next person who does this (or comparable silliness). >> Thanks for your reply, I'm off to comment on the GitHub blog post to >> try to warn others to use Unicorn::Worker#user instead of the example >> code in after_fork. > > Thanks, that seems to be a general problem with people relying on > blog/mailing list posts instead of consistently updated documentation. Indeed, but I read most of the unicorn docs, and examples/unicorn.conf.rb in 3.3.1 doesn't mention Unicorn::Worker#user, so I remained unaware until I read through worker.rb. Hey, I can help here. Here's a patch: From de3178d98c81de3c8765cebd579ef3f7dd4b2d64 Mon Sep 17 00:00:00 2001 From: Emmanuel Gomez Date: Tue, 12 Apr 2011 15:36:36 -0700 Subject: [PATCH] Document Unicorn::Worker#user in example unicorn conf. --- examples/unicorn.conf.rb | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/examples/unicorn.conf.rb b/examples/unicorn.conf.rb index 28a9e65..8b7ad47 100644 --- a/examples/unicorn.conf.rb +++ b/examples/unicorn.conf.rb @@ -84,4 +84,8 @@ after_fork do |server, worker| # and Redis. TokyoCabinet file handles are safe to reuse # between any number of forked children (assuming your kernel # correctly implements pread()/pwrite() system calls) + + # if running the master process as root and the workers as an unprivileged + # user, do this to switch euid/egid in the workers (also chowns logs): + # worker.user("unprivileged_user", "unprivileged_group") end -- 1.7.3.4 From normalperson at yhbt.net Tue Apr 12 18:51:05 2011 From: normalperson at yhbt.net (Eric Wong) Date: Tue, 12 Apr 2011 22:51:05 +0000 Subject: Struggling with logrotate and unicorn In-Reply-To: References: <8A1F87B7-F4A6-4186-AE22-604F875C7F29@gmail.com> <20110412175855.GA21250@dcvr.yhbt.net> <91269EF1-4FEC-4CD3-82EE-4DF48F2544EE@gmail.com> <20110412185901.GA32009@dcvr.yhbt.net> Message-ID: <20110412225105.GA20096@dcvr.yhbt.net> Emmanuel Gomez wrote: > On Apr 12, 2011, at 11:59 AM, Eric Wong wrote: > > I'll make that more robust and release 3.6.0 sometime this week with > > (hopefully) a few other minor improvements. > > Great. This is apparently an infrequent circumstance (uncommon > configuration?), but there will be a next person who does this (or > comparable silliness). Yes, I think most people still deploy and start as non-root (Capistrano/Vlad). But I also distribute init scripts and those are usually run as root :x > >> Thanks for your reply, I'm off to comment on the GitHub blog post > >> to try to warn others to use Unicorn::Worker#user instead of the > >> example code in after_fork. > > > > Thanks, that seems to be a general problem with people relying on > > blog/mailing list posts instead of consistently updated > > documentation. > > Indeed, but I read most of the unicorn docs, and > examples/unicorn.conf.rb in 3.3.1 doesn't mention > Unicorn::Worker#user, so I remained unaware until I read through > worker.rb. Actually the (usually) user-visible one should be Unicorn::Configurator#user which should be in the top-level. Worker#user is just the internal call. > Hey, I can help here. Here's a patch: Perhaps this is better? I added a blurb discouraging people from running as root in the first place. You'll still get credit :) >From c4d3cd7d7b32ed133e25e3740c8e7a3493592eec Mon Sep 17 00:00:00 2001 From: Emmanuel Gomez Date: Tue, 12 Apr 2011 15:36:36 -0700 Subject: [PATCH] Document "user" directive in example unicorn conf --- examples/unicorn.conf.rb | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/examples/unicorn.conf.rb b/examples/unicorn.conf.rb index 28a9e65..61f0b4b 100644 --- a/examples/unicorn.conf.rb +++ b/examples/unicorn.conf.rb @@ -12,6 +12,13 @@ # more will usually help for _short_ waits on databases/caches. worker_processes 4 +# Since Unicorn is never exposed to outside clients, it does not need to +# run on the standard HTTP port (80), there is no reason to start Unicorn +# as root unless it's from system init scripts. +# If running the master process as root and the workers as an unprivileged +# user, do this to switch euid/egid in the workers (also chowns logs): +# user "unprivileged_user", "unprivileged_group" + # Help ensure your application will always spawn in the symlinked # "current" directory that Capistrano sets up. working_directory "/path/to/app/current" # available in 0.94.0+ -- Eric Wong From emmanuel.gomez at gmail.com Tue Apr 12 19:01:09 2011 From: emmanuel.gomez at gmail.com (Emmanuel Gomez) Date: Tue, 12 Apr 2011 16:01:09 -0700 Subject: Struggling with logrotate and unicorn In-Reply-To: <20110412225105.GA20096@dcvr.yhbt.net> References: <8A1F87B7-F4A6-4186-AE22-604F875C7F29@gmail.com> <20110412175855.GA21250@dcvr.yhbt.net> <91269EF1-4FEC-4CD3-82EE-4DF48F2544EE@gmail.com> <20110412185901.GA32009@dcvr.yhbt.net> <20110412225105.GA20096@dcvr.yhbt.net> Message-ID: <8847BCFC-1FA6-4075-B6B0-FC86D68793CE@gmail.com> On Apr 12, 2011, at 3:51 PM, Eric Wong wrote: > Yes, I think most people still deploy and start as non-root > (Capistrano/Vlad). But I also distribute init scripts and those > are usually run as root :x And it's because of init scripts that I'm running unicorn as root. > Actually the (usually) user-visible one should be > Unicorn::Configurator#user which should be in the top-level. > Worker#user is just the internal call. Oh, great, I'm glad you pointed that out. Since the worker instance is yielded into the after_fork block, I started looking there. I'll update my config to use the public interface. Also, I'll go correct my github blog post comment, oops. >> Hey, I can help here. Here's a patch: > > Perhaps this is better? I added a blurb discouraging people from > running as root in the first place. Looks great. > You'll still get credit :) It's a nothing, I don't need any credit :) From chengjiasi14ahan at yahoo.de Tue Apr 12 18:50:37 2011 From: chengjiasi14ahan at yahoo.de (Rick) Date: Wed, 13 Apr 2011 06:50:37 +0800 Subject: =?GB2312?B?RGlnaXRhbCBQaG90byBFZGl0aW5nIFNlcg==?= =?GB2312?B?dmljZXMgLSBQaG90byBDdXRvdXQgU2Vydg==?= =?GB2312?B?aWNl?= Message-ID: <20110412224359.1B5841BEB3B1@cctmail.ceramic-chengteh.com> You are receiving this email because we wish you to use our digital photo editing services. Digital Photo Editing Services : We are a China based Imaging Professionals. We offer basic and advanced digital photo Editing services and solutions like photo Cutout, morphological photo Editing, photoshop photo Editing, satellite photo Editing, color photo Editing and vector photo Editing using latest techniques. Our strength in providing Editing solutions for digital images like photo masking, photo re-touching, back ground cleaning & cloning, sharpening & restoration of color, all this derive from our vast experience. Our dedicated team of highly skilled and experienced professionals serves the photo Editing requirements of our clients. An in house quality checking mechanism assures value addition and delivers perfect job. Our team can deliver your job overnight or in time bounded fashion irrespective of job size. Our mainly services are: 1. Photo Cutout 2. Photo Enhancement 3. Photo Retouching 4. Vector Conversion 5. Pop Art 6. Images Masking 7. Clipping Path 8. Photo Restoration 9. Web Design Photo Editing Services: Our Photo Editing services includes advanced photo cutouts/clippings, balancing brightness / contrast in an image, repair of minor scratches, creases, minor dust, and spot removal to removal of major scratches, cracks, creases, and stains in all areas. We also repair seriously faded/damaged photographs and make it print ready. Best regards, Rick Ricksonman Imaging Professionals Contact: rickimage at yeah.net Send address to koremoveid at yeah.net for remove From iveryshshneworki at mail.ru Thu Apr 14 08:06:37 2011 From: iveryshshneworki at mail.ru (=?Windows-1251?B?0ODhb/LgINfPIO1hIG/h+WXpIPHoY/Ll7OU=?=) Date: Thu, 14 Apr 2011 16:06:37 +0400 Subject: =?Windows-1251?B?QmPlIOJv5+xv5u37ZSBjeOXs+yDxIGHvcGXr/w==?= Message-ID: <499689315.20110414297317@smtp.harddriveme.com> ----------------------------------------------------------------------------------- |B?? ??? ??C????? ??E??P?????????. ?c? ?o??o???? c?e?? c 1.04.2011 | |??o????? ?????P????????? - ??x?????? ?a???????? ?o?e???, | |pe?????????? ???c???? ?p????????????? ? ????a? ?e???o???? AK???. | ----------------------------------------------------------------------------------- > Ce???a? ? 18 ??p??? ? 2011 ?. > ?. K?e? ? ??. ????o??????, 12 > ?e?.: (044) 331-?4-14, 592-75-6? > ????P???? > B??? ?E??E??????? ?? (?p?????? ????a? ?o ???a? ????e???o???, ?e ??e?????? > ? C???????????? e???o?o ?a???a: ?a? ce????? ?o??? ??pa?????????? o???????): ??o????? c ??c???????? ? ?epe??? pa?????????? ??????x? ???o? ?e??????????. ??e?????? ??????o ?o????????? ???oc? ?p? ????a?? ?ox??? ??e??p????????? - ????e ?o???e??? ????o ??e?o??????? ?p.????. > B?????? ????a c 2011?., K???A ????a ?o????? ? ?ac?????, "?p???????e" ?e??????e ?????e???: ?o???? ?e ???a?e???? ?E???? ?????. ??c????????? ?o????? ?a?o?????? ?pa? ?ac????? ? ?o?o???. ??p??? ?a ?e?p???????? ?a?o??e???. ?ep?????????? ???o?????? (??e??e???...), ?o??? ?? o???a?????? ??, c?e?a? ?o???o????? ?a?????, ?e???e??? ??e?a ?o?ap?? ?o ??c?? ?ea???????. ?a?o??e??? ??a?? pa?????? -3 ?ap?a???. ?a? ??c?? pac???? ?e? ??????p??????? ?o??????o?. ????O???? ??K??E??? ?a ?O??? ??PA??, ?e?pa??????? ???e??? ??e?a (?pa?????? ??a??? p??o?? ? 2010 ? 2011 ?.): 2-?p????? p?????, 45% ?.? ?a? ?pa?????o ?a?????? c??? ????a. ???a?? ?o???e??o? ?a ?o????? ?o???? (?c???) ? ?o??o ?? ?e ??e?? ?????e??? ?a ?p??o? ????p?, ??o ?e?a??, ?c?? ?x ?e?. O?pa????? ??p???? ????e ????o? o??p????: ?????a ?????c? ?p??o?????, ?????e??? ?po???. - ??pa? ?a ?e ??e? ?o??p??-???????????? ?e??oc??? - ?o???? ?o?? ?e??? ?p??e?????? ?a ??a????e. H????H?? ???E???? ??PA?????. ?a??? ?????e??? ?????a?? ?????a?e?? (???A?A B?E??? - A HE ?O???O ??O ?PE?O??????). ?a??? ?o??a?????? a??? ? ??o? ???p??? ????? ?e????o???? ? 2011 ?. (???o??? ?e?c????? ? c?????). > ?P??????.????????! ?pa?????? - ?a? ?p??e???? ce?? ??p?? ??o??????, ??o?? ?e ?o????? ? ??pa? 7,5 ???! (?p? o??p??? 500 ??c.). > ?PO????? ??????o?o ?e?e????? ???a?????: ??o????????, ?o???o????? ?a?????, o????c???? ??e???????????......... ?a??e ?p????a ? c?o?? ????e????? ?A????E???? ?POB????. > H?E???? ???O?????. ????o ?? ???e??????????????? ???????e ? ?p???a????-????????. ?a????e??? ??a???????-???????? ?o?o?o??? c pa?o???????: c ?a???? ???e??????? ?a???????? ?e???? ??????a??, ??a?????????? ??????a ?a???o????????? ?o ?p????o?? ? ?p???a????-?????????. ?o??a ??a???????-???????? ?o?o?o? ???a???? ?o? ?a?o???????????. ?o????? ?a??c????? ? o??a????? ? o?????o??? e???o?o co????????? ???oc? - ?a??e ????? ????e???, ?o?o??? ?e ???o ?o c?x ??p. ?A??????? ???O???????????? ??O ?P??: c ?e? ?e?o??? c??????????? ??e????????????, ????e o????? ?p?????? ? ??O??B??? O??????????????. ????????o????: ?a??e o??????? ?o???? ?????a?? ?o?o??????. > ???????a??? ?????o????????? c 1.04.2011 ??? ?ex, ??o p?????? ?a e???o? ???o?e: ? Bo????????? ?e?????o ?o?????? ?a????? ?o? 0- 10-11-15-17%: ?o ??e? ?o??????x ?o?????????. Pa?????? ????e????? ?a??????? ???o? ? ????o?????? ?e ??a???? ???o?? (?e ?a??) c 1.04.2011. O????????????? c?e? o?op???? - 300 ??c., 500 ??c., 1???. ? ??c??????????? ??ep????: ?o??cc??, ?o???????, ?????c???. ????e????? ?oc???????? ??? ???????a??? ?a?o???????????. ? ?o????a ?o?ap? ? ?? c 1.04.2011- ?a? "o?????" ?a?pe? o??o???? ?a p?????? ?o ?p?????. ? ?c???? ?o K??? 72, 74. ??????e ????????a??? c ?o??? ?pe??? ???a??????? ? ?e????ap?????? ?a??????????????. ??????e ?e??e??????? o? o?e?????. K?? ?e ?o??c?? ? ?p??????e c????? ????o?????, ??????????. ? B?e ??o ?e??????o??? ? c?ep? ???o??a??????? (72 ?o? KBE?) c 1.04.2011. H???? ?? ?? c?????????? ????o?o??? ??? ??a?a??? ???x ?c???. ???????????e ?????c????? ???c?a?? ?a ??? ?e??. ? ?o??? ?? ????a???a?? ??B??E??? "????a ?ax??????" ? ?e? ?p?????. ? "?o??o???e ?a???" ?A?O????? K?????? - ?o??a ?p???e?c? ?c? ?p????? o????? ?o?????????. ? ??C, ?p?????, H???, ECB - o?ep????, ?p? ???op?? ?e? ?? o????? ?a???a. ? ???o????????? ???o?? ??_??pe???e??_???????? c 2011 ?. Pa???? ?? c o???? ?p?????????? - ?p?????a ??o?e???. > ?P????????? ???O ????e????? e?????o ?a???a. ? ??a???? ?e????? ????a????????? ????a. B ?e? ?a????????? ??p??e?????? ????a ? ??????e??? K???? ??e?? ?o????? ? p???????. ??c???????? ?e???o??????. ? ?oc??????????? o??????? ??? ?p.??? - ?a?????e ?o?x??? ?H?? ? ?p.? ???.???a?. ? ??e ??e?? ?o???e??? ?a????? - o? 0 ?o 17% ?o??p? > ???????C??? ???O ?a ???o?o??? ?a??????x. ? ??o ?o??? ??pe??? (??pa??????? ?o ???a? ?e??????????) ? o?pa??????? ?o ???????o????? ???e? ? "?o??????? ?a???" ?o ?????e ???o???. > ?P????EC??? ???O, oc??e????????? ?o?c????????????, ??x?a????????, ?p?????c??? ?c????... ? o?p????????, ????????e c ??a????????e?(?????????????????) ?c??? > ?a???? "?O?P???????" ?ec??????? ?? ? ?pe??p?????: ?????a?? ? ?? ??? ???a?? ?apa???????. ??????e??? 500 ??c. H??O?????? ?C?? ? O??O? ????CE. E??? "?o?p???????" c???????? ???a. Pa?o?? ?o? ???o? ?o?????? ?ap?o?. C????????????? ??P?? ? ?? c 2011?. - ????e? ?o???????????: ??o???? ???e c????????????, o?????e ?e??: ????e ?ea??? c 2011 ?. Ko??? o??p???? ?o???a?? ?o? ?????????p???. ???a?a H??? c ?o??o? ? 2011 ?.- c ?a?o? ??e???o????? ?a??????????? ??a????? H???. > ?OCP?????????? ?E??E??H????: ?o????? c??a ?p? o?????????? - ??o ?a??e ??p????. ?e? ?o?????? ?????a???? o? ?????e???, ????c??????? ????e?????, ?????x ???p?????????? ?????o???. ??O ?E???? CE?O??? ??CP??????? ?a ??O?????. > APE???/????????? c 1.04.2011. ????e??? ?? a????? ?c?????? ????o ?? ???e? o??oc??? ap???? ?a ?ac???? c 1.04.2011 ?p? ?p???? ?: ? ?? ???????a, ? ???. ???a. H???c? ?p????e??? ?o????? "?????a????? ????a a???????? ??a?e??" > PA?O?? ?O ?OBE???????? O? ?p???p?????????: ?o??o ?? c?a???? o?????, ?o?????? ?a??- ??o ????p???, ?c?? ???????c?, ??o ???o?? ???a ?e?o??a????. > Pa?o?? ?? ?a O??E? ??C?E??: ec?? ?e ???e? ????e???o??? - ????o ?? ??a???? e????? co??a????? ????c, ?a? pa???????? (?e ??a????) ??a?c???? ??a?e??. ???o?? ?a o???? c?c?e??: ????e ????o ???a?????? ???o??, ?p????e??? ?a??????? a??ap???. HOB?? ?o???o? ???e??? ????a ?? ?a o???? c???e?? - o?????? ??p???a ?e?e??? ???o?? ??e??p????????? ? ?a?????? p????????. ????e?????? ??c??c???? ?p??????? ?????e???? ?a ?o?a? ? ?? ?a o??e? c?c?e??. K???e ?o??????? ??o??????? ?o??????? ?e?, ??o ??e?? ???a???? ?c?a??? ?p? ?epe???? ?a o???? c???e??, ?oc???????? ?????c???? ?o???????? ?o o??????? c 1.04.2011 > A??op? ? ??????e ?????a??: ? ????????a? ?p??a ??o?e??? - a????op, ???o? ??????a??? ? ?pec??, ????? ?E????? ?a?o? ??? ?p????????? ? ?????????x ????. ? ?p??o????? A??p?? ????o??? - ?p???, ??e???? ?o???o? o??? ???p?? (c??o?) c ????p?????????? o??????? ?a ???p??? ?a?o??????????????. > PAC??????? ? Pe????????? c 9:30 ?o 10:00 ? Ha???? ? 10:00 ? O????a??? ? 17:00 > ??O??O??? ? 750.00 ?p?. ?a ???o?? ??a?????a (?p? ???a?? ?a ?O?). ? 830.00 ?p?. ?a ???o?? ??a?????a (?p? o??a?e ?a ?p. ???o). ? ??? ??opo?o ? ?pe????o ??ac????? c????? ? 15% ? B c?o??oc?? ?xo???: ???op?a?????o-???????????????? ??c?????a??e ?a c????ap?, c?o???? ?a????a???, ???a???, o?????e??e ?o????o? ? o??e? ??e????? c ?e??op??. ? Ka???? ??ac???? ?o???ae? ????a??epc??? ?o???e?? ?o???e??o?. ? ????? ??????????? ??????? ??????? ?????? ????????? ?????? ????????? ????????? ?????? ??????????? ????? ??????? ??????????? ????????? ????? ???? ?????? ??????? ????? ???????? ???????? ????????? ?????? ?????? ? ??p??????????????? ?o??o ?o: (044) ?31-64-14, 592-75-6? From normalperson at yhbt.net Tue Apr 19 14:13:48 2011 From: normalperson at yhbt.net (Eric Wong) Date: Tue, 19 Apr 2011 18:13:48 +0000 Subject: unicorn 3.6.0 release soon Message-ID: <20110419181348.GA5103@dcvr.yhbt.net> Mainly small fixes, improvements, and workarounds for fork() issues with pseudo-random number generators shipped with Ruby (Kernel#rand, OpenSSL::Random (used by SecureRandom and also by Rails). If there are any other fixes/improvements that could be useful let us know. I think this is nearing the end of the line for the 3.x series which will then go into maintenance mode. I'm looking at 4.x being the crazy series that allows us to run thousands of worker _processes_ and scale to mythical 4096 core systems :) The PRNG issues are documented in depth here (and links to Ruby Redmine): http://bogomips.org/unicorn.git/commit?id=1107ede7 http://bogomips.org/unicorn.git/commit?id=b3241621 If you're too lazy to upgrade, you can just do this in your after_fork hooks: after_fork do |server,worker| tmp = srand OpenSSL::Random.seed(tmp.to_s) if defined?(OpenSSL::Random) end There are also small log reopening (SIGUSR1) improvements: * relative paths may also be reopened, there's a small chance this will break with a handful of setups, but unlikely. This should make configuration easier especially since the "working_directory" configurator directive exists. Brought up by Matthew Kocher: http://thread.gmane.org/gmane.comp.lang.ruby.unicorn.general/900 * workers will just die (and restart) if log reopening fails for any reason (including user error). This is to workaround the issue reported by Emmanuel Gomez: http://thread.gmane.org/gmane.comp.lang.ruby.unicorn.general/906 -- Eric Wong From normalperson at yhbt.net Thu Apr 21 02:56:49 2011 From: normalperson at yhbt.net (Eric Wong) Date: Thu, 21 Apr 2011 06:56:49 +0000 Subject: [ANN] unicorn 3.6.0 - small fixes, PRNG workarounds Message-ID: <20110421065649.GA20263@dcvr.yhbt.net> Changes: Mainly small fixes, improvements, and workarounds for fork() issues with pseudo-random number generators shipped with Ruby (Kernel#rand, OpenSSL::Random (used by SecureRandom and also by Rails). The PRNG issues are documented in depth here (and links to Ruby Redmine): http://bogomips.org/unicorn.git/commit?id=1107ede7 http://bogomips.org/unicorn.git/commit?id=b3241621 If you're too lazy to upgrade, you can just do this in your after_fork hooks: after_fork do |server,worker| tmp = srand OpenSSL::Random.seed(tmp.to_s) if defined?(OpenSSL::Random) end There are also small log reopening (SIGUSR1) improvements: * relative paths may also be reopened, there's a small chance this will break with a handful of setups, but unlikely. This should make configuration easier especially since the "working_directory" configurator directive exists. Brought up by Matthew Kocher: http://thread.gmane.org/gmane.comp.lang.ruby.unicorn.general/900 * workers will just die (and restart) if log reopening fails for any reason (including user error). This is to workaround the issue reported by Emmanuel Gomez: http://thread.gmane.org/gmane.comp.lang.ruby.unicorn.general/906 * http://unicorn.bogomips.org/ * mongrel-unicorn at rubyforge.org * git://bogomips.org/unicorn.git -- Eric Wong From curtis.schofield at gmail.com Mon Apr 25 12:37:05 2011 From: curtis.schofield at gmail.com (Curtis j Schofield) Date: Mon, 25 Apr 2011 09:37:05 -0700 Subject: Unicorn / Daemontools Message-ID: Hi - I tried to get Daemontools and Unicorn working together a while back - there are issues on USR2 restart because of the pid change - I'm hoping someone in the community will have some understanding of this issue I documented my experience and eventual defeat here : http://log.robotarmyma.de/post/2053448029/daemontools-ubuntu-rvm-bundler-unicorn-install Any help would be received graciously. -- make haste slowly \ festina lente ?\ - mobile ?+1_415_632_6001 curtis.schofield at gmail.com http://robotarmyma.de From normalperson at yhbt.net Mon Apr 25 14:34:58 2011 From: normalperson at yhbt.net (Eric Wong) Date: Mon, 25 Apr 2011 11:34:58 -0700 Subject: Unicorn / Daemontools In-Reply-To: References: Message-ID: <20110425183458.GA5826@dcvr.yhbt.net> Curtis j Schofield wrote: > I tried to get Daemontools and Unicorn working together a while back - > there are issues on USR2 restart because of the pid > change - I'm hoping someone in the community will have some > understanding of this issue I have no experience with daemontools directly, but I expect any solutions people found to make daemontools work with nginx USR2 would also work for unicorn since they have the same process/signal model. Maybe a hacky way would be to have daemontools run this wrapper script instead of Unicorn: -------------------------------- 8< ------------------------- #!/bin/sh set -e # this script is totally untested and written by someone who's never # used daemontools # start Unicorn in the background: bundle exec unicorn -D ... # forward signals received in this wrapper to the Unicorn process: for sig in HUP USR1 USR2 QUIT TERM QUIT do trap 'kill -'$sig' $(cat $UNICORN_PID_FILE)' $sig done # loop forever while Unicorn has its pid file # a smarter, Linux-only version of this would use inotify instead while test -f $UNICORN_PID_FILE do sleep 1 done -- Eric Wong From curtis.schofield at gmail.com Mon Apr 25 15:03:57 2011 From: curtis.schofield at gmail.com (Curtis j Schofield) Date: Mon, 25 Apr 2011 12:03:57 -0700 Subject: Unicorn / Daemontools In-Reply-To: <20110425183458.GA5826@dcvr.yhbt.net> References: <20110425183458.GA5826@dcvr.yhbt.net> Message-ID: On Mon, Apr 25, 2011 at 11:34 AM, Eric Wong wrote: > Curtis j Schofield wrote: >> I tried to get Daemontools and Unicorn working together a while back - >> there are issues on USR2 restart because of the pid >> change - I'm hoping someone ?in the community will have some >> understanding of this issue > > I have no experience with daemontools directly, but I expect any > solutions people found to make daemontools work with nginx USR2 > would also work for unicorn since they have the same process/signal > model. > > Maybe a hacky way would be to have daemontools run this wrapper > script instead of Unicorn: > > -------------------------------- 8< ------------------------- > #!/bin/sh > set -e > > # this script is totally untested and written by someone who's never > # used daemontools > > # start Unicorn in the background: > bundle exec unicorn -D ... > > # forward signals received in this wrapper to the Unicorn process: > for sig in HUP USR1 USR2 QUIT TERM QUIT > do > ? ? ? ?trap 'kill -'$sig' $(cat $UNICORN_PID_FILE)' $sig > done > > # loop forever while Unicorn has its pid file > # a smarter, Linux-only version of this would use inotify instead > while test -f $UNICORN_PID_FILE > do > ? ? ? ?sleep 1 > done > Eric! This is fascinating! If i run a wrapper with unicorn as a child process - i can detect the absence of the wrapper - and i can detect the absence of the pid file - but i cannot detect a hard fail in the unicorn process unless i have some kind of pipe open to the child and register that failure. Is my understanding correct? Daemontools is design to take a process that is running in the foreground and monitor it - keep it alive - the breakdown in unicorn is when a USR2 arrives at unicorn - and the pid switch occurs - daemon tools believes it has lost the process. I see this as a design flaw in all pid based monitoring solutions - in my experiences. > -- > Eric Wong > _______________________________________________ > Unicorn mailing list - mongrel-unicorn at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-unicorn > Do not quote signatures (like this one) or top post when replying > -- make haste slowly \ festina lente ?\ - mobile ?+1_415_632_6001 curtis.schofield at gmail.com http://robotarmyma.de From normalperson at yhbt.net Mon Apr 25 17:01:42 2011 From: normalperson at yhbt.net (Eric Wong) Date: Mon, 25 Apr 2011 14:01:42 -0700 Subject: Unicorn / Daemontools In-Reply-To: References: <20110425183458.GA5826@dcvr.yhbt.net> Message-ID: <20110425210142.GA13953@dcvr.yhbt.net> Curtis j Schofield wrote: > On Mon, Apr 25, 2011 at 11:34 AM, Eric Wong wrote: > > while test -f $UNICORN_PID_FILE > > do > > ? ? ? ?sleep 1 > > done > > If i run a wrapper with unicorn as a child process - i can detect the > absence of the wrapper - and > i can detect the absence of the pid file - but i cannot detect a hard > fail in the unicorn process unless i have some kind of pipe > open to the child and register that failure. > > Is my understanding correct? Yes, but the absence of the pid file usually means the unicorn process failed hard. Only unicorn error logs can tell you that definitively, though. I would probably make the wrapper script "exit 1" after the while loop in my script... > Daemontools is design to take a process that is running in the > foreground and monitor it - keep it alive - the breakdown in unicorn > is when a USR2 arrives at unicorn - and the pid switch occurs - daemon > tools believes it has lost the process. > > I see this as a design flaw in all pid based monitoring solutions - in > my experiences. Yes, it's a problem with the monitoring solution trying to do the job of the unicorn master process. Unicorn is designed to use the master process and there's no other way to do what Unicorn does without it. The unicorn master process itself should be very robust and never fail during normal operation (upgrades may break it if things go really wrong, but you already pay attention to what you're upgrading, right?). -- Eric Wong From curtis.schofield at gmail.com Mon Apr 25 17:58:46 2011 From: curtis.schofield at gmail.com (Curtis j Schofield) Date: Mon, 25 Apr 2011 14:58:46 -0700 Subject: Unicorn / Daemontools In-Reply-To: <20110425210142.GA13953@dcvr.yhbt.net> References: <20110425183458.GA5826@dcvr.yhbt.net> <20110425210142.GA13953@dcvr.yhbt.net> Message-ID: > > Yes, it's a problem with the monitoring solution trying to do the job of > the unicorn master process. ?Unicorn is designed to use the master > process and there's no other way to do what Unicorn does without it. > > The unicorn master process itself should be very robust and never fail > during normal operation (upgrades may break it if things go really > wrong, but you already pay attention to what you're upgrading, right?). > I'm not concerned about the unicorn process failing - more i use daemon tools on boot and to make sure the process comes alive properly at boot and because daemon tools has a simple and intelligent interface that doesn't have me writing blue-pill conf files or monit conf files. That said - it may be enough to monitor that wrapper script in this case. -- make haste slowly \ festina lente ?\ - mobile ?+1_415_632_6001 curtis.schofield at gmail.com http://robotarmyma.de From snacktime at gmail.com Mon Apr 25 18:07:15 2011 From: snacktime at gmail.com (snacktime) Date: Mon, 25 Apr 2011 15:07:15 -0700 Subject: Unicorn / Daemontools In-Reply-To: References: Message-ID: There are USR2 patches for daemontools, we used them for unicorn on a large production app worked just fine. Can't remember the url but google should show it. Chris Ochs On Mon, Apr 25, 2011 at 9:37 AM, Curtis j Schofield wrote: > Hi ?- > > I tried to get Daemontools and Unicorn working together a while back - > there are issues on USR2 restart because of the pid > change - I'm hoping someone ?in the community will have some > understanding of this issue > > I documented my experience and eventual defeat here : > http://log.robotarmyma.de/post/2053448029/daemontools-ubuntu-rvm-bundler-unicorn-install > > > Any help would be received graciously. > > -- > make haste slowly \ > festina lente ?\ > - > mobile ?+1_415_632_6001 > curtis.schofield at gmail.com > http://robotarmyma.de > _______________________________________________ > Unicorn mailing list - mongrel-unicorn at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-unicorn > Do not quote signatures (like this one) or top post when replying > From curtis.schofield at gmail.com Mon Apr 25 19:18:58 2011 From: curtis.schofield at gmail.com (Curtis j Schofield) Date: Mon, 25 Apr 2011 16:18:58 -0700 Subject: Unicorn / Daemontools In-Reply-To: References: Message-ID: I read one possible patch - it doesn't do pid handling - just lets svc send different signals My understanding of how unicorn responds to USR2 is that it changes it's pid and respawns - this would mean that Daemontools is now monitoring the wrong pid and will think the process went down. On Mon, Apr 25, 2011 at 3:07 PM, snacktime wrote: > There are USR2 patches for daemontools, we used them for unicorn on a > large production app worked just fine. ?Can't remember the url but > google should show it. > > Chris Ochs > > On Mon, Apr 25, 2011 at 9:37 AM, Curtis j Schofield > wrote: >> Hi ?- >> >> I tried to get Daemontools and Unicorn working together a while back - >> there are issues on USR2 restart because of the pid >> change - I'm hoping someone ?in the community will have some >> understanding of this issue >> >> I documented my experience and eventual defeat here : >> http://log.robotarmyma.de/post/2053448029/daemontools-ubuntu-rvm-bundler-unicorn-install >> >> >> Any help would be received graciously. >> >> -- >> make haste slowly \ >> festina lente ?\ >> - >> mobile ?+1_415_632_6001 >> curtis.schofield at gmail.com >> http://robotarmyma.de >> _______________________________________________ >> Unicorn mailing list - mongrel-unicorn at rubyforge.org >> http://rubyforge.org/mailman/listinfo/mongrel-unicorn >> Do not quote signatures (like this one) or top post when replying >> > _______________________________________________ > Unicorn mailing list - mongrel-unicorn at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-unicorn > Do not quote signatures (like this one) or top post when replying > -- make haste slowly \ festina lente ?\ - mobile ?+1_415_632_6001 curtis.schofield at gmail.com http://robotarmyma.de From ghazel at gmail.com Tue Apr 26 18:38:10 2011 From: ghazel at gmail.com (ghazel at gmail.com) Date: Tue, 26 Apr 2011 15:38:10 -0700 Subject: [ANN] unicorn 3.6.0 - small fixes, PRNG workarounds In-Reply-To: <20110421065649.GA20263@dcvr.yhbt.net> References: <20110421065649.GA20263@dcvr.yhbt.net> Message-ID: Is it possible there is a problem with this change? Since I upgraded to 3.6.0 I have encountered two collisions on ActiveSupport::SecureRandom.hex(64), which seems very unlikely, since it has never happened in the history of my app otherwise. -Greg On Wednesday, April 20, 2011, Eric Wong wrote: > Changes: > > Mainly small fixes, improvements, and workarounds for fork() issues > with pseudo-random number generators shipped with Ruby (Kernel#rand, > OpenSSL::Random (used by SecureRandom and also by Rails). > > The PRNG issues are documented in depth here (and links to Ruby Redmine): > > ?http://bogomips.org/unicorn.git/commit?id=1107ede7 > ?http://bogomips.org/unicorn.git/commit?id=b3241621 > > If you're too lazy to upgrade, you can just do this in your after_fork > hooks: > > ?after_fork do |server,worker| > ? ?tmp = srand > ? ?OpenSSL::Random.seed(tmp.to_s) if defined?(OpenSSL::Random) > ?end > > There are also small log reopening (SIGUSR1) improvements: > > * relative paths may also be reopened, there's a small chance this > ?will break with a handful of setups, but unlikely. ?This should > ?make configuration easier especially since the "working_directory" > ?configurator directive exists. ?Brought up by Matthew Kocher: > ?http://thread.gmane.org/gmane.comp.lang.ruby.unicorn.general/900 > > * workers will just die (and restart) if log reopening fails for > ?any reason (including user error). ?This is to workaround the issue > ?reported by Emmanuel Gomez: > ?http://thread.gmane.org/gmane.comp.lang.ruby.unicorn.general/906 > > > * http://unicorn.bogomips.org/ > * mongrel-unicorn at rubyforge.org > * git://bogomips.org/unicorn.git > > -- > Eric Wong > _______________________________________________ > Unicorn mailing list - mongrel-unicorn at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-unicorn > Do not quote signatures (like this one) or top post when replying > From normalperson at yhbt.net Tue Apr 26 19:01:05 2011 From: normalperson at yhbt.net (Eric Wong) Date: Tue, 26 Apr 2011 16:01:05 -0700 Subject: [ANN] unicorn 3.6.0 - small fixes, PRNG workarounds In-Reply-To: References: <20110421065649.GA20263@dcvr.yhbt.net> Message-ID: <20110426230105.GA25428@dcvr.yhbt.net> ghazel at gmail.com wrote: > On Wednesday, April 20, 2011, Eric Wong wrote: > > Changes: > > > > Mainly small fixes, improvements, and workarounds for fork() issues > > with pseudo-random number generators shipped with Ruby (Kernel#rand, > > OpenSSL::Random (used by SecureRandom and also by Rails). > > > > The PRNG issues are documented in depth here (and links to Ruby Redmine): > > > > ?http://bogomips.org/unicorn.git/commit?id=1107ede7 > > ?http://bogomips.org/unicorn.git/commit?id=b3241621 (top-posting corrected) > Is it possible there is a problem with this change? Since I upgraded > to 3.6.0 I have encountered two collisions on > ActiveSupport::SecureRandom.hex(64), which seems very unlikely, since > it has never happened in the history of my app otherwise. Oops, the return value of srand shouldn't be relied on, I need to call Kernel#rand instead. My attempt to fix things actually made the problem worse (which is why I pushed upstream Ruby to fix the problem, first :). The following should fix it (3.6.1 release coming): diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb index d70de45..3077b95 100644 --- a/lib/unicorn/http_server.rb +++ b/lib/unicorn/http_server.rb @@ -492,11 +492,11 @@ class Unicorn::HttpServer def after_fork_internal @ready_pipe.close if @ready_pipe self.ready_pipe = nil # XXX Rainbows! compat, change for Unicorn 4.x - tmp = srand # http://redmine.ruby-lang.org/issues/4338 + srand # http://redmine.ruby-lang.org/issues/4338 # The OpenSSL PRNG is seeded with only the pid, and apps with frequently # dying workers can recycle pids - OpenSSL::Random.seed(tmp.to_s) if defined?(OpenSSL::Random) + OpenSSL::Random.seed(rand.to_s) if defined?(OpenSSL::Random) end def spawn_missing_workers -- Eric Wong From normalperson at yhbt.net Tue Apr 26 19:11:03 2011 From: normalperson at yhbt.net (Eric Wong) Date: Tue, 26 Apr 2011 23:11:03 +0000 Subject: [ANN] unicorn 3.6.1 - fix OpenSSL PRNG workaround Message-ID: <20110426231103.GA15250@dcvr.yhbt.net> Changes: Our attempt in 3.6.0 to workaround a problem with the OpenSSL PRNG actually made the problem worse. This release corrects the workaround to properly reseed the OpenSSL PRNG after forking. Thanks to ghazel for the report! * http://unicorn.bogomips.org/ * mongrel-unicorn at rubyforge.org * git://bogomips.org/unicorn.git -- Eric Wong From normalperson at yhbt.net Tue Apr 26 19:17:30 2011 From: normalperson at yhbt.net (Eric Wong) Date: Tue, 26 Apr 2011 16:17:30 -0700 Subject: [ANN] unicorn 3.6.0 - small fixes, PRNG workarounds In-Reply-To: <20110421065649.GA20263@dcvr.yhbt.net> References: <20110421065649.GA20263@dcvr.yhbt.net> Message-ID: <20110426231730.GB31098@dcvr.yhbt.net> Eric Wong wrote: > If you're too lazy to upgrade, you can just do this in your after_fork > hooks: > > after_fork do |server,worker| > tmp = srand > OpenSSL::Random.seed(tmp.to_s) if defined?(OpenSSL::Random) > end Do this instead if you're too lazy to upgrade: after_fork do |server,worker| srand OpenSSL::Random.seed(rand.to_s) if defined?(OpenSSL::Random) end 3.6.1 has a similar fix. Thanks to ghazel for reporting the bug. -- Eric Wong From normalperson at yhbt.net Wed Apr 27 14:13:17 2011 From: normalperson at yhbt.net (Eric Wong) Date: Wed, 27 Apr 2011 11:13:17 -0700 Subject: Rails streaming example video Message-ID: <20110427181317.GA17625@dcvr.yhbt.net> Aaron Patterson gladly provided us with a streaming video which I've agreed to host: http://unicorn.bogomips.org/streaming.ogv If anybody has more Unicorn/Rainbows!-related videos/slides/etc in Free Software-friendly formats, I'd be more than glad to host or mirror them. Thanks Aaron! -- Eric Wong From normalperson at yhbt.net Wed Apr 27 17:12:40 2011 From: normalperson at yhbt.net (Eric Wong) Date: Wed, 27 Apr 2011 14:12:40 -0700 Subject: [PATCH 0/2] attempting to clarify docs for streaming In-Reply-To: <20110427181317.GA17625@dcvr.yhbt.net> References: <20110427181317.GA17625@dcvr.yhbt.net> Message-ID: <1303938762-32318-1-git-send-email-normalperson@yhbt.net> Since streaming responses is becoming a topic nowadays, I figure we should attempt to clarify configuration options relevant to it. In general, I think the defaults for both Unicorn and Rainbows! in their targeted environments are reasonable and do not need more tuning. I've pushed out the following two patches to git://bogomips.org/unicorn.git: * [PATCH 1/2] examples/nginx.conf: clarify proxy_buffering for Rails * [PATCH 2/2] configurator: attempt to clarify Feedback is greatly appreciated as always. -- Eric Wong From normalperson at yhbt.net Wed Apr 27 17:12:41 2011 From: normalperson at yhbt.net (Eric Wong) Date: Wed, 27 Apr 2011 14:12:41 -0700 Subject: [PATCH 1/2] examples/nginx.conf: clarify proxy_buffering for Rails 3.1 In-Reply-To: <1303938762-32318-1-git-send-email-normalperson@yhbt.net> References: <20110427181317.GA17625@dcvr.yhbt.net> <1303938762-32318-1-git-send-email-normalperson@yhbt.net> Message-ID: <1303938762-32318-2-git-send-email-normalperson@yhbt.net> I've tested with nginx 1.0.0 and confirmed "proxy_buffering off;" can cause Unicorn to block on a slow client reading a large response. While there's a potential (client-visible) performance improvement with Rails 3.1 streaming responses, it can also hurt the server with slow clients. Rainbows! with (ThreadSpawn or ThreadPool) is probably the best way to do streaming responses efficiently from all angles (from a server, client and programmer time perspective). --- examples/nginx.conf | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/examples/nginx.conf b/examples/nginx.conf index 52ec245..9f245c8 100644 --- a/examples/nginx.conf +++ b/examples/nginx.conf @@ -125,10 +125,15 @@ http { proxy_redirect off; # set "proxy_buffering off" *only* for Rainbows! when doing - # Comet/long-poll stuff. It's also safe to set if you're - # using only serving fast clients with Unicorn + nginx. - # Otherwise you _want_ nginx to buffer responses to slow - # clients, really. + # Comet/long-poll/streaming. It's also safe to set if you're using + # only serving fast clients with Unicorn + nginx, but not slow + # clients. You normally want nginx to buffer responses to slow + # clients, even with Rails 3.1 streaming because otherwise a slow + # client can become a bottleneck of Unicorn. + # + # The Rack application may also set "X-Accel-Buffering (yes|no)" + # in the response headers do disable/enable buffering on a + # per-response basis. # proxy_buffering off; proxy_pass http://app_server; -- Eric Wong From normalperson at yhbt.net Wed Apr 27 17:12:42 2011 From: normalperson at yhbt.net (Eric Wong) Date: Wed, 27 Apr 2011 14:12:42 -0700 Subject: [PATCH 2/2] configurator: attempt to clarify :tcp_nopush/:tcp_nodelay In-Reply-To: <1303938762-32318-1-git-send-email-normalperson@yhbt.net> References: <20110427181317.GA17625@dcvr.yhbt.net> <1303938762-32318-1-git-send-email-normalperson@yhbt.net> Message-ID: <1303938762-32318-3-git-send-email-normalperson@yhbt.net> These options will probably be more important as interest in streaming responses in Rails 3.1 develops. I consider the respective defaults for Unicorn (designed to run behind nginx) and Rainbows! (designed to run standalone) to be the best choices in their respective environments. --- lib/unicorn/configurator.rb | 22 +++++++++++++++------- 1 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/unicorn/configurator.rb b/lib/unicorn/configurator.rb index 73869de..bed3abe 100644 --- a/lib/unicorn/configurator.rb +++ b/lib/unicorn/configurator.rb @@ -253,24 +253,32 @@ class Unicorn::Configurator # # [:tcp_nodelay => true or false] # - # Disables Nagle's algorithm on TCP sockets if +true+ + # Disables Nagle's algorithm on TCP sockets if +true+. + # + # Setting this to +true+ can make streaming responses in Rails 3.1 + # appear more quickly at the cost of slightly higher bandwidth usage. + # The effect of this option is most visible if nginx is not used, + # but nginx remains highly recommended with \Unicorn. # # This has no effect on UNIX sockets. # - # Default: operating system defaults (usually Nagle's algorithm enabled) + # Default: +false+ (Nagle's algorithm enabled) in \Unicorn, + # +true+ in Rainbows! # # [:tcp_nopush => true or false] # # Enables/disables TCP_CORK in Linux or TCP_NOPUSH in FreeBSD # - # This is enabled by default as of Unicorn 3.4. This prevents partial - # TCP frames from being sent out and reduces wakeups in nginx if it is - # on a different machine. Since Unicorn is only designed for applications - # that send the response body quickly without keepalive, sockets will - # always be flushed on close to prevent delays. + # This prevents partial TCP frames from being sent out and reduces + # wakeups in nginx if it is on a different machine. Since \Unicorn + # is only designed for applications that send the response body + # quickly without keepalive, sockets will always be flushed on close + # to prevent delays. # # This has no effect on UNIX sockets. # + # Default: +true+ in \Unicorn 3.4+, +false+ in Rainbows! + # # [:tries => Integer] # # Times to retry binding a socket if it is already in use -- Eric Wong From normalperson at yhbt.net Wed Apr 27 20:57:27 2011 From: normalperson at yhbt.net (Eric Wong) Date: Wed, 27 Apr 2011 17:57:27 -0700 Subject: adding GPLv3 to unicorn license Message-ID: <20110428005727.GA19557@dcvr.yhbt.net> Hello, I would like to extend the unicorn license from (GPLv2|Ruby terms) to (GPLv2|GPLv3|Ruby terms). Zed and Evan are still the authors of much of the HTTP parser code in unicorn and some of the tests, so I'm asking you guys first. I would also like to license kcar[1] in the same way since it's a fork of the unicorn parser (for client-side usage). Adding GPLv3 would allow AGPLv3-only applications to be bundled with unicorn and distributed. This would be useful for people distributing complete devices running AGPLv3 apps on unicorn. I'm a supporter of strong copyleft licenses and I want unicorn to be distributable with applications with strong copyleft licenses. Furthermore, I (or whoever replaces me as project leader when I die) would like to have the option of adding compatibility for newer versions of the GPL (as published by the FSF). I'm /not/ asking for a "GPLv2 or later" clause since that would give the FSF too much power for GPLv4. I'm not at all interested in adding licenses other than future versions of the GPL. Even though I support AGPLv3 for user-facing applications, I do /not/ want infrastructure like unicorn to be under the terms of something like the AGPLv3. I'll email the other contributors who have more trivial contributions if you guys agree. Thanks! (Please Cc: mongrel-unicorn at rubyforge.org when replying to keep this public, thanks!) [1] - http://bogomips.org/kcar/ -- Eric Wong From normalperson at yhbt.net Wed Apr 27 20:59:03 2011 From: normalperson at yhbt.net (Eric Wong) Date: Wed, 27 Apr 2011 17:59:03 -0700 Subject: [RFC/PATCH] LICENSE: add GPLv3 to license terms In-Reply-To: <20110428005727.GA19557@dcvr.yhbt.net> References: <20110428005727.GA19557@dcvr.yhbt.net> Message-ID: <20110428005903.GA22995@dcvr.yhbt.net> Here's a proposed patch for the exact wording: diff --git a/LICENSE b/LICENSE index d48c2d4..386aa40 100644 --- a/LICENSE +++ b/LICENSE @@ -1,8 +1,17 @@ Unicorn is copyrighted free software by all contributors, see logs in -revision control for names and email addresses of all of them. You can -redistribute it and/or modify it under either the terms of the -{GPL2}[http://www.gnu.org/licenses/gpl-2.0.txt] (see link:COPYING) or -the conditions below: +revision control for names and email addresses of all of them. + +You can redistribute it and/or modify it under either the terms of the +GNU General Public License (GPL) as published by the Free Software +Foundation (FSF), version {3.0}[http://www.gnu.org/licenses/gpl-3.0.txt] +or version {2.0}[http://www.gnu.org/licenses/gpl-2.0.txt] +or the Ruby-specific license terms (see below). + +The unicorn project leader (Eric Wong) reserves the right to add future +versions of the GPL (and no other licenses) as published by the FSF to +the licensing terms. + +=== Ruby-specific terms (if you're not using the GPLv2/GPLv3) 1. You may make and give away verbatim copies of the source form of the software without restriction, provided that you duplicate all of the -- Eric Wong From looasuta48inasi at yahoo.com Wed Apr 27 14:57:41 2011 From: looasuta48inasi at yahoo.com (Louis) Date: Thu, 28 Apr 2011 02:57:41 +0800 Subject: =?GB2312?B?M0QvMkQgQW5pbWF0aW9uIHNlcnZpY2VzIA==?= =?GB2312?B?LSBDYXJ0b29uIE1vdmllIC0gM0QgbW9kZQ==?= =?GB2312?B?bGluZw==?= Message-ID: You are receiving this email because we wish you to use our 3D/2D animation services. We are a China based animation studio. We are specialized in providing 3D designing/modelling/animation services across the globe. We utilize the finest equipment available in the industry, offer efficient data delivery and unrivaled quality and work until the client is fully satisfied with the end product. We pushed past the limitations of technology and hardware to bring 3D walk-through animations and animated effects to the Web, VHS, DVD and now High-Definition. 3d Animation services 3D Modeling Character.Set.Props. Modeling , and Environment Creation Painting Textures layout Uv,painting the Colour.Bump. Normal Map .etc 3D Animation Rigging.Skinning.Aanimation for game and film Custom 3D Modeling Whether you're looking for an inexpensive alternative to 3D model conversion software or just need your latest creative masterpiece to import correctly into your new favorite software, we can help! Architectures Services Interior/exterior architecture rendering Architecture animation Core Offerings 3D Animation 4D Animation 3D Modelling 3D Rendering 2D Animation 2D/3D Game Animation 2D/3D Game Development Cartoon Architecture Visualization Character Animation Animated Commercial Product Modelling Animated Presentation Walkthrough Animation Flash Presentation Logo Animation Flash Animation Flash Games Product Demos Medical Animation Animated Movies Flash Gateways Animated Wallpapers Animated Graphics Best regards, Louis Lanasonfan Animation Services Contact: anicontact at yeah.net Pls send address to koremoveid at yeah.net for remove From normalperson at yhbt.net Fri Apr 29 19:20:25 2011 From: normalperson at yhbt.net (Eric Wong) Date: Fri, 29 Apr 2011 16:20:25 -0700 Subject: OobGC fixed in unicorn.git Message-ID: <20110429232025.GA2581@dcvr.yhbt.net> Looks like OobGC was totally busted since 3.3.1 and 1.1.6 because nginx uses HTTP/1.0 relies on a closed socket (and not Content-Length:/Transfer-Encoding) to detect the end of a response. New release coming soon, anything else? -- Eric Wong From normalperson at yhbt.net Sat Apr 30 02:45:28 2011 From: normalperson at yhbt.net (Eric Wong) Date: Sat, 30 Apr 2011 06:45:28 +0000 Subject: [ANN] unicorn 3.6.2 (and 1.1.7) - fix Unicorn::OobGC module Message-ID: <20110430064528.GA8211@dcvr.yhbt.net> Changes: The optional Unicorn::OobGC module is reimplemented to fix breakage that appeared in v3.3.1. There are also minor documentation updates, but no code changes as of 3.6.1 for non-OobGC users. There is also a v1.1.7 release to fix the same OobGC breakage that appeared for 1.1.x users in the v1.1.6 release. * http://unicorn.bogomips.org/ * mongrel-unicorn at rubyforge.org * git://bogomips.org/unicorn.git -- Eric Wong