This basically a prettier way of saying: Dir.chdir(Unicorn::HttpServer::START_CTX[:cwd] = path) In the config file. Unfortunately, this is configuration directive where order matters and you should specify it before any other path directives if you're using relative paths (relative paths are not recommended anyways)  pid, stderr_path, stdout_path
Even if START_CTX[:cwd] is pointing to another directory, avoid overriding the user's decision to Dir.chdir if they do it in either the Unicorn config file or the config.ru.
split out uncommon code from the common path
Just write bytes to the file instead and track its size increase instead of its mode. As of now all the unit tests pass under FreeBSD 7.2.
`sh -c pwd` doesn't reliably read ENV["PWD"] on all platforms, this means that directories that are symlinks may be ignored and the real path is resolved. This can be problematic when doing upgrades for common deployment systems such as Capistrano which rely on the working directory being a symlink.
setsid(8) is non-portable, but we depend on Ruby already and it's trivial to implement; so just use the Ruby-only version
Explicitly specify that we mean to use stdin/stdout since not all tar(1) implementations default to it.
Not documented on FreeBSD 7.2, but it seems to happen there and searching around, it seems to happen on other systems, too...
If fstat() fails on an open file descriptor in the master, something is seriously wrong (like your kernel is broken/buggy) and trying to restart the worker that owned that file descriptor is likely masking the symptoms. Instead let the error propagate up to the main loop to avoid wasting cycles to restart broken workers.
This release fixes a regression introduced in 0.93.3 where timed-out worker processes run a chance of not being killed off at all if they're hung. While it's not ever advisable to have requests take a long time, we realize it's easy to fix everything :) Eric Wong (3): TODO: remove --kill fix reliability of timeout kills TODO: update for next version (possibly 1.0-pre)
The method introduced in commit 6c8a3d3 to avoid killing workers after suspend/hibernate interacted badly with the change for OpenBSD fchmod(2) compatibility introduced with the 0.93.3 release. This interaction lead to workers with files stuck in the zero state to never be murdered off for timeout violations. Additionally, the method to avoid killing processes off was never completely reliable and has been reworked even if we entered suspend/hibernate/STOP during client processing. This regression was discovered during continued development of the Rainbows! test suite (which we will bring over as it becomes ready).
I'm still having a hard time justifying this...
This release mainly works around BSD stdio compatibility issues that affect at least FreeBSD and OS X. While this issues was documented and fixed in [ruby-core:26300], no production release of MRI 1.8 has it, and users typically upgrade MRI more slowly than gems. This issue does NOT affect 1.9 users. Thanks to Vadim Spivak for reporting and testing this issue and Andrey Stikheev for the fix. Additionally there are small documentation bits, one error handling improvement, and one minor change that should improve reliability of signal delivery. Andrey Stikheev (1): workaround FreeBSD/OSX IO bug for large uploads Eric Wong (7): DESIGN: address concerns about on-demand and thundering herd README: alter reply conventions for the mailing list configurator: stop testing for non-portable listens KNOWN_ISSUES: document Rack gem issue w/Rails 2.3.2 stop continually resends signals during shutdowns add news bodies to site NEWS.atom.xml configurator: fix broken example in RDoc Suraj N. Kurapati (1): show configuration file path in errors instead of '(eval)'  http://redmine.ruby-lang.org/issues/show/2267
Under FreeBSD writing to the file in sync mode does not change current position, so change position to the end of the file. Without this patch multipart post requests with large data (image uploading) does not work correctly: Status: 500 Internal Server Error bad content body /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/utils.rb:347:in `parse_multipart' /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/utils.rb:319:in `loop' /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/utils.rb:319:in `parse_multipart' File position behavior under FreeBSD : ruby -v ruby 1.8.7 (2009-04-08 patchlevel 160) [i386-freebsd7] irb(main):001:0> b = File.new("abc", "w+") => #<File:abc> irb(main):002:0> b.sync = true => true irb(main):004:0> b.write("abc") => 3 irb(main):005:0> b.pos => 0 Acked-by: Eric Wong <firstname.lastname@example.org>
While we're at it, remove trailing whitespace for author names, too.
Since our :QUIT and :TERM signal handlers are idempotent, we can safely retry sending signals in case workers don't/can't handle them them the first time around. This appears to be a problem with the Thread-based concurrency models in Rainbows! not behaving well (no surprise, though, since pthreads and signals are difficult to manage/mix properly).
In short: upgrade to Rails 2.3.4 (or later) ref: http://mid.gmane.org/20091014221552.GA30624@dcvr.yhbt.net Note: the workaround described in the article above only made the issue more subtle and we didn't notice them immediately.
also __FILE__ did not reflect configuration file path
IPv4 addresses in the format of: "^[[:digit:]]+:[[:digit:]]+$" isn't very portable..
Mailman is now configured to munge Reply-To: to point back to the mailing list. This might make things easier for folks on low traffic mailing lists like ours.
Based on a private email I just received.
This release fixes compatibility with OpenBSD (and possibly other Unices with stricter fchmod(2) implementations) thanks to Jeremy Evans. Additionally there are small documentation changes all around. Eric Wong (11): doc: expand on the SELF_PIPE description fchmod heartbeat flips between 0/1 for compatibility examples/init.sh: remove "set -u" configurator: update with nginx fail_timeout=0 example PHILOSOPHY: clarify experience other deployments PHILOSOPHY: plug the Rainbows! spin-off project README: remove unnecessary and extraneous dash DESIGN: clarification and possibly improve HTML validity README: remove the "non-existent" part README: emphasize the "fast clients"-only part drop the whitespace cleaner for Ragel->C
Generated C code is no longer checked into git so it doesn't matter.
While Unicorn is one of very many Unix-only, pre-forking, shared socket servers in existence, and Unicorn is _definitely_ not the only server that only works *well* with fast clients, either. But as far as we know, Unicorn is the first (and so far only) server that emphasizes only working well with fast clients.
Still pretty rare, though.
It's "Ragel+C" (as well as being Ragel->C) because there is C code in the parser. Oddly, validator.w3.org doesn't complain about the unescaped ">", but we'll err on the safe side for blissful ignorance.
I've only served in an advisory role in most of those instances and I relied on feedback from other folks (especially for Tomcat since I know almost nothing about that).
It has come to our attention that this setting is not very well-known to the rest of the world...
It's too simple of a script and causes running the init script with zero arguments to fail instead of printing out the usage message.
This removes the Time.now.to_i comparison that was used to avoid multiple, no-op fchmod() syscalls within the same second. This should allow us to run on OpenBSD where it can raise EINVAL when Time.now.to_i is passed to it. Reported-by: Jeremy Evans <email@example.com>  - gettimeofday() from Time.now is not a real syscall on VDSO-enabled x86_64 GNU/Linux systems where Unicorn is primarily developed.