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

Process.daemon redirects all output to /dev/null by default #5

Closed
Type-kun opened this issue May 15, 2017 · 2 comments
Closed

Process.daemon redirects all output to /dev/null by default #5

Type-kun opened this issue May 15, 2017 · 2 comments

Comments

@Type-kun
Copy link

When no arguments are specified, Process.daemon redirects all output to /dev/null; therefore, if the service is run directly via bundle exec ruby services/sqs_processor.rb --logfile=my.log --pidfile=my.pid, no output is logged. After changing the line to Process.daemon(true, true), it executes fine and logs output as expected.

Disclaimer: I have no idea what sets the RUN environment variable, because googling that turned out quite difficult.

@r888888888
Copy link
Owner

RUN is something you would set when you don't want it to detach. There's an example of its usage in the Procfile.

@Type-kun
Copy link
Author

Keep in mind that setting the arguments as (nil, true) will make the script change its working dir to /, and attempt to create log and pid files there. This would fail unless you run it as root or have write permission on /, or specify the full path for log and pid files. Setting the arguments as (true, true) will make the script stay in the same directory.

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