英文:
How to create a daemon process in Golang?
问题
有人在这里用Golang编写过守护进程吗?你能帮我解释一下如何做到这一点吗?欢迎提供有用的链接。
英文:
Has anyone here written a deamon process in Golang? Can you walk me through how to do that? Useful links are welcome.
答案1
得分: 23
是的,这已经完成了。请参考go-daemon项目。请注意,在启动goroutine之后进行守护进程化时可能会出现一些问题。请参考issue 227了解详细信息。
目前,我建议您使用操作系统提供的工具。请参考这个相关问题以获取解决方案。
英文:
Yes this has been done. See the go-daemon project. Be aware that there are certain problems when the daemonization happens after goroutines are launched. See issue 227 for details.
At this time I'd recommend to use the utilities your operating system offers you. See this related question for solutions.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论