代码之家  ›  专栏  ›  技术社区  ›  Umesh Malhotra

Monit未启动进程-执行失败错误

  •  0
  • Umesh Malhotra  · 技术社区  · 7 年前

    我正在使用monit gem来监视我的sidekiq进程 我的MONTRC配置文件:-

    check process sidekiq_process with pidfile /home/path_to_pid
    start program = "bundle exec sidekiq -d -L log/sidekiq.log -C config/sidekiq.yml -e development"  with timeout 60 seconds
    stop program  = "bundle exec sidekiq -d -L log/sidekiq.log -C config/sidekiq.yml -e development"
    

    我的sidekiq。yml文件:-

     development:
    :pidfile: tmp/pids/sidekiq_development.pid
    :logfile: log/sidekiq_development.log
    :concurrency: 1
    

    运行sidekiq后,使用 bundle exec sidekiq -d -L log/sidekiq.log -C config/sidekiq.yml -e development 然后跑 sudo monit , sudo monit status 给我这个:-

    Process 'sidekiq_process'
    status                            Running
    monitoring status                 Monitored
    pid                               10951
    parent pid                        1378
    uid                               1000
    effective uid                     1000
    gid                               1000
    uptime                            0m 
    threads                           2
    children                          0
    memory                            103.4 MB
    memory total                      103.4 MB
    memory percent                    1.3%
    memory percent total              1.3%
    cpu percent                       0.0%
    cpu percent total                 0.0%
    data collected                    Mon, 13 Aug 2018 12:14:06
    

    所以,它的监控很好,当我终止sidekiq进程时,它甚至会向我发送邮件“不存在”,但问题是在sidekiq进程终止后,它还应该重新启动进程。这是什么 sudo monit状态 在sidekiq被杀后给我的

    Process 'sidekiq_process'
    status                            Execution failed
    monitoring status                 Monitored
    data collected                    Mon, 13 Aug 2018 12:19:13
    

    我还收到邮件说“执行失败”。
    为什么我得到执行失败的错误,为什么进程没有被monit重新启动?

    1 回复  |  直到 7 年前
        1
  •  1
  •   Viktova    7 年前

    将exec命令封装在shell脚本中,chmod+x,然后检查我的答案 here