From: Eric Wong <normalperson@yhbt.net>
To: Chris Wanstrath <chris@ozmm.org>
Cc: mongrel-unicorn@rubyforge.org
Subject: Re: Pidfiles and cwd?
Date: Sat, 5 Sep 2009 10:15:14 -0700 [thread overview]
Message-ID: <20090905171514.GA8761@dcvr.yhbt.net> (raw)
In-Reply-To: <20090905042806.GA9507@dcvr.yhbt.net>
Eric Wong <normalperson@yhbt.net> 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
next prev parent reply other threads:[~2009-09-05 17:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <8b73aaca0909042020w73fb03dfpf6c77c85c1c486ad@mail.gmail.com>
2009-09-05 3:21 ` Pidfiles and cwd? Chris Wanstrath
2009-09-05 4:28 ` Eric Wong
2009-09-05 17:15 ` Eric Wong [this message]
2009-09-06 0:50 ` Chris Wanstrath
2009-09-06 1:38 ` Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://yhbt.net/unicorn/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090905171514.GA8761@dcvr.yhbt.net \
--to=normalperson@yhbt.net \
--cc=chris@ozmm.org \
--cc=mongrel-unicorn@rubyforge.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhbt.net/unicorn.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).