unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* Unicorn tempfile chown problem with Ruby 1.9
@ 2010-06-19  0:19 Andreas Neuhaus
  2010-06-19  2:44 ` Eric Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Neuhaus @ 2010-06-19  0:19 UTC (permalink / raw)
  To: mongrel-unicorn

Hi everybody,

I ran into a problem with unicorn today. Using Ruby 1.9.2-preview3
(compiled by rvm) and a unicorn config that has a "user" statement to
let workers run under a different user, unicorn fails to start any
worker process:

/usr/local/rvm/gems/ruby-1.9.2-preview3/gems/unicorn-1.0.0/lib/unicorn.rb:189:in
`chown': No such file or directory - /tmp/0.8216141026704238
(Errno::ENOENT)
	from /usr/local/rvm/gems/ruby-1.9.2-preview3/gems/unicorn-1.0.0/lib/unicorn.rb:189:in
`user'
	from /usr/local/rvm/gems/ruby-1.9.2-preview3/gems/unicorn-1.0.0/lib/unicorn.rb:664:in
`init_worker_process'
	from /usr/local/rvm/gems/ruby-1.9.2-preview3/gems/unicorn-1.0.0/lib/unicorn.rb:681:in
`worker_loop'
	from /usr/local/rvm/gems/ruby-1.9.2-preview3/gems/unicorn-1.0.0/lib/unicorn.rb:598:in
`block (2 levels) in spawn_missing_workers'

>From what I see, Worker#user tries to chown the unlinked worker
tempfile (in unicorn.rb:189), which fails with Ruby 1.9.2, but seems
to work fine with Ruby 1.8.7. The problem happened to me on an Ubuntu
server, but I was able to reproduce it locally on OSX.

How to reproduce:
- create a simple rack app, like
class Hello; def call (env); [200, { 'Content-Type' => 'text/plain' },
['Hello!']]; end; end
run Hello.new
- create a unicorn.conf.rb with a user statement that switches to the
current user
user 'andy'
- run "unicorn -c unicorn.conf.rb" on Ruby 1.9.2
- watch workers failing to start

I'm not that deep into unicorn's internals, but since the worker
tempfile is unlinked anyway, does it actually make sense to still call
chown on it? Removing tmp.chown in Worker#user solved this for me.

Please cc replies since I'm not subscribed to the list, thanks.

regards,
Andreas Neuhaus
http://zargony.com/
_______________________________________________
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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-06-19 13:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-19  0:19 Unicorn tempfile chown problem with Ruby 1.9 Andreas Neuhaus
2010-06-19  2:44 ` Eric Wong
2010-06-19 13:38   ` Andreas Neuhaus

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).