在Golang中如何创建一个守护进程?

huangapple go评论91阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2014年5月19日 18:59:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/23736046.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定