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

Ability to specify the pidfile via args in FreeBSD #20

Closed
tidwall opened this issue Jun 8, 2016 · 5 comments
Closed

Ability to specify the pidfile via args in FreeBSD #20

tidwall opened this issue Jun 8, 2016 · 5 comments

Comments

@tidwall
Copy link
Owner

tidwall commented Jun 8, 2016

Currently the pidfile must be managed outside the application. Adding an arg to the startup process will streamline this process. See #19.

@tidwall
Copy link
Owner Author

tidwall commented Jun 14, 2016

@olevole I was thinking I would add a parameter named --pidfile path. When provided the process would daemonize. Does this seem like a reasonable approach?

@olevole
Copy link
Contributor

olevole commented Jun 14, 2016

@tidwall Absolutely! Currenlty, i've made rc.d script for FreeBSD:

http://pastebin.com/jPmpqrwx

where i got pid from daemon(8). It is necessary for correct stop command; with --pidfile tile38 would be self-sufficient for rc.d subsystem.

@tidwall
Copy link
Owner Author

tidwall commented Jun 21, 2016

@olevole Apparently daemonizing a Go app is a little more challenging that I expected. I was hoping for a simple solution by just forking and rerouting logging and such. But fork and posix threads don't always play well with Goroutines. It sometimes works, but isn't totally stable.

There's a whole long discussion about it dating back to 2009. golang/go#227

There may still be a way yet, but it may take more tinkering on my side. Sorry for the delay on this. I'll keep you posted when I find a stable solution.

@olevole
Copy link
Contributor

olevole commented Feb 24, 2017

Thank you very much!

@tidwall
Copy link
Owner Author

tidwall commented Feb 24, 2017

You're welcome and sorry about the delay.

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