Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

absolute paths required when daemonized? #15

Closed
rcarver opened this issue Apr 13, 2010 · 3 comments
Closed

absolute paths required when daemonized? #15

rcarver opened this issue Apr 13, 2010 · 3 comments

Comments

@rcarver
Copy link

rcarver commented Apr 13, 2010

In Ruby < 1.9, :config and :pid must be absolute paths because Rack::Server does Dir.chdir "/" before reading the :config and writing the :pid. This was unexpected - is it intended?

@raggi
Copy link
Member

raggi commented Apr 13, 2010

It is considered good practice on *nix based filesystems to chdir to the root so that filesystems can be unmounted as necessary. It is arguable that doing this to most running ruby apps will not have good results as most code out there incorrectly ignores some errnos, however, that portion of the problem is not related to rack. A developer familiar with good daemonization practices should expect this, and indeed it is commonly documented.

http://www.sbin.org/doc/unix-faq/programmer/faq_2.html#SEC16
http://www.enderunix.org/docs/eng/daemon.php
http://www.developerweb.net/forum/archive/index.php/t-3025.html

@rcarver
Copy link
Author

rcarver commented Apr 14, 2010

Fair enough. Would be nice get get some errors back from instead of writing them to /dev/null

@raggi
Copy link
Member

raggi commented Apr 14, 2010

Again, closing stdio is part of a standard daemonization process, setup Rack::CommonLogger with an appropriate log file path.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants