Unicorn tempfile chown problem with Ruby 1.9
zargony at gmail.com
Sat Jun 19 09:38:36 EDT 2010
>> `chown': No such file or directory - /tmp/0.8216141026704238
> This is a bug in Ruby and I've filed a report and patch in Redmine:
Thanks. I started to watch that ticket to see where it goes. In the
meantime, I tried to workaround the problem by telling unicorn to
chown the tempfile before it's unlinked (which looks like it works
fine for now). http://gist.github.com/444901
> Unicorn needs to fchmod(2) it as the regular user for the heartbeat
> functionality to work (master process continues to run as root
> if started as root).
> Is Unicorn actually able to serve requests when you removed tmp.chown?
> Under Linux, fchmod() doesn't work without ownership of the file.
You're right, it doesn't work if tmp.chown is removed. For
convenience, I always tried it on my local machine as a user and
chown'ed to my own user to trigger the problem. This way I could test
things without running it as root. When running unicorn with tmp.chown
removed as root, it throws EPERM errors as you expected.
More information about the mongrel-unicorn