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

(enhancement) Expose dup2() from libc, Daemon optionally redirect str… #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davebrown
Copy link

…eams

Allow user to redirect stdout, stderr after fork() instead of closing them.
Expose dup() and dup2() in CLibrary to accomplish the above. Add dup2()
unit test.

I have a Dropwizard service that I would like to daemonize. Some of the dependencies
I'm using write to stdout and stderr, and they get errors when they're closed and the
service fails to boot.

The change here uses dup2() to redirect them to files in the log directory instead.

…eams

Allow user to redirect stdout, stderr after fork() instead of closing them.
Expose dup() and dup2() in CLibrary to accomplish the above. Add dup2()
unit test.
@davebrown
Copy link
Author

@kohsuke will you take a look at this PR?

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

Successfully merging this pull request may close these issues.

1 participant