From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS14383 205.234.109.0/24 X-Spam-Status: No, score=-0.7 required=5.0 tests=AWL,MSGID_FROM_MTA_HEADER, RP_MATCHES_RCVD shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.unicorn.general Subject: Re: Pidfiles and cwd? Date: Sat, 5 Sep 2009 10:15:14 -0700 Message-ID: <20090905171514.GA8761@dcvr.yhbt.net> References: <8b73aaca0909042020w73fb03dfpf6c77c85c1c486ad@mail.gmail.com> <8b73aaca0909042021v25d5f0eajd926250f71623042@mail.gmail.com> <20090905042806.GA9507@dcvr.yhbt.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1252170932 23828 80.91.229.12 (5 Sep 2009 17:15:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Sep 2009 17:15:32 +0000 (UTC) Cc: mongrel-unicorn@rubyforge.org To: Chris Wanstrath Original-X-From: mongrel-unicorn-bounces@rubyforge.org Sat Sep 05 19:15:25 2009 Return-path: Envelope-to: gclrug-mongrel-unicorn@m.gmane.org X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org Content-Disposition: inline In-Reply-To: <20090905042806.GA9507@dcvr.yhbt.net> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: mongrel-unicorn@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: mongrel-unicorn-bounces@rubyforge.org Errors-To: mongrel-unicorn-bounces@rubyforge.org Xref: news.gmane.org gmane.comp.lang.ruby.unicorn.general:16 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.50) id 1MjyrD-0005WA-85 for gclrug-mongrel-unicorn@m.gmane.org; Sat, 05 Sep 2009 19:15:23 +0200 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 9B44F1858121; Sat, 5 Sep 2009 13:15:22 -0400 (EDT) Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by rubyforge.org (Postfix) with ESMTP id 4B0F418581F6 for ; Sat, 5 Sep 2009 13:15:15 -0400 (EDT) Received: from localhost (user-118bg0q.cable.mindspring.com [66.133.192.26]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPSA id D75581F793; Sat, 5 Sep 2009 17:15:14 +0000 (UTC) Eric Wong wrote: > > B) Is there a reason `unicorn_rails` must start in the app root and > > doesn't allow it as a config option? > > Since the config file is just Ruby, you can just Dir.chdir inside it. > And since the chdir is done when the config file is evaluated, the > chdir can be done across restarts/reloads (you can point it to a > symlinked directory) to pick up new code/releases. > > If you do that, I would initially start Unicorn in "/" or some other > directory that won't get deleted so you'll be safe for upgrades. > > If you managed to forget that, you can set the following in your > Unicorn config: > > Unicorn::HttpServer::START_CTX[:cwd] = "/" Maybe having a 'working_directory "/path/to/app/root"' that does: Dir.chdir(Unicorn::HttpServer::START_CTX[:cwd] = arg) Internally would make things easier? I see nginx has a "working_directory" config option as well: http://wiki.nginx.org/NginxHttpMainModule -- Eric Wong