From: Eric Wong <normalperson@yhbt.net>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Subject: Re: Home directory for workers
Date: Tue, 11 Oct 2011 08:16:01 +0000 [thread overview]
Message-ID: <20111011081601.GA4208@dcvr.yhbt.net> (raw)
In-Reply-To: <20111010222545.GA30758@dist.ro>
neil@dist.ro wrote:
> When unicorn is started as the root user and the worker processes run
> as as an unprivileged user because of the "user" option in
> unicorn.conf then the home directory of the worker processes is still
> "/root". This causes trouble with GPGME at least, which expects to
> find encryption keys in the user's home directory.
You mean the ENV["HOME"] value? This typically isn't changed when
changing privileges in other daemons like nginx. Changing ENV["HOME"]
automatically inside unicorn has the potential to break existing setups
badly, so it won't be done.
However, you can set it in your after_fork hook (or anywhere else in
your unicorn config file)
after_fork do |server,worker|
ENV["HOME"] = "/home/user"
end
You can even set it in the shell when starting unicorn:
HOME=/home/user unicorn -c unicorn.conf.rb
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying
prev parent reply other threads:[~2011-10-11 8:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-10 22:25 Home directory for workers neil
2011-10-11 8:16 ` Eric Wong [this message]
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=20111011081601.GA4208@dcvr.yhbt.net \
--to=normalperson@yhbt.net \
--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).