kostya / eye

Process monitoring tool. Inspired from Bluepill and God.
MIT License
1.19k stars 86 forks source link

Eye won't start with Puma in Ubuntu 16.04 LTS #186

Closed spajus closed 7 years ago

spajus commented 7 years ago
$ eye load config/puma.eye 
server has not started in 15 seconds, something is very wrong

Error is from here: https://github.com/kostya/eye/blob/master/lib/eye/cli/server.rb#L66-L68

Config:

  RAILS_ENV = 'production'                                                                              
  ROOT = '/home/web/appname/current'                                                                         

  Eye.config do                                                                                                  
    logger "#{ROOT}/log/eye.log"                                                                                 
  end                                                                                                            

  Eye.application :appname do                                                                                
    env 'RAILS_ENV' => RAILS_ENV                                                                                 
    working_dir ROOT                                                                                             
    trigger :flapping, times: 10, within: 1.minute                                                               

    process :puma do                                                                                             
      daemonize true                                                                                             
      pid_file 'tmp/pids/puma.pid'                                                                               
      stdall 'log/puma.log'                                                                                      

      start_command "bundle exec puma -C config/puma.rb"                       
      stop_signals [:TERM, 5.seconds, :KILL]                                                                     
      restart_command 'kill -USR2 {PID}'                                                                         

      restart_grace 10.seconds                                                                                   

      check :cpu, every: 30, below: 80, times: 3                                                                 
      check :memory, every: 30, below: 140.megabytes, times: [3, 5]               
    end                                                                                                          
  end    

Puma itself starts without issue with bundle exec puma -C config/puma.rb. Eye works with same config in Ubuntu 14.04 LTS.

Ruby 2.4.0 (but reproduced in 2.3.x as well)

kostya commented 7 years ago

this seems not puma related, looks like sigar problem. https://github.com/kostya/eye/issues/181

spajus commented 7 years ago

@kostya thanks for quick response. This workaround solves the issue: gem install sigar -- --with-cppflags="-fgnu89-inline"

nisanthchunduru commented 7 years ago

@spajus Thanks for posting the workaround. Manually installing the sigar gem before installing eye solved the issue

gem install sigar -- --with-cppflags="-fgnu89-inline"
gem install eye