https://github.com/ochinchina/supervisord
这是golang版本进程守护,不需要任何环境,支持windows,linux
配置程序 c.conf

[inet_http_server]
port=:9001
#username = 123
#password = 123
[program:gf]
directory=/qq
command=./gf
stdout_logfile = gf.log
startretries=3 #自动重启时间
autostart=true
autorestart=true

运行,自动到后台
./supervisord -c c.conf -d

另一个 c++版本个人更喜欢,支持win,linux
https://gitee.com/love_linger/supervisor

{
   "user" : [
      {
         "account" : "123",
         "pswd" : "123"
      }
   ],
   "watcher" : [
      {
         "cmd" : "./gf",
         "dir" : "/qq",
         "name" : "gf",
         "retry" : 3
      },
      {
         "cmd" : "./weui6",
         "dir" : "/www",
         "name" : "weui6",
         "retry" : 3
      }
   ]
}

启动到后台
./supervisor port=9001 daemon

文档更新时间: 2021-11-28 21:26   作者:Yoby