golang 后台运行方式

1.直接用下面的命令方式运行 

 nohup ./main & 

2.使用

go get github.com/icattlecoder/godaemon

在main包下

_ "github.com/icattlecoder/godaemon"

 运行命令

./example -d=true

GitHub地址:https://github.com/icattlecoder/godaemon

推荐阅读

Linux 技巧:让进程在后台可靠运行的几种方法 https://www.ibm.com/developerworks/cn/linux/l-cn-nohup/index.html

你可能感兴趣的:(golang 后台运行方式)