rvm monit delayed_job

前端 未结 2 1473
长发绾君心
长发绾君心 2021-01-07 06:06

I am trying to run delayed_job using monit, but its failing to run as rvm\'s paths (local rvm installation per user basis) are not available to the command. My application i

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-07 06:36

    If you already have properly working monit with other services and just need to add delayed_job daemon for rvm environment you can try to use this conf file (it works for me)

    /etc/monit/conf.d/delayed_job.conf (i have ubuntu server)

    check process delayed_job with pidfile /{project_folder}/tmp/pids/delayed_job.pid
    start program = "RAILS_ENV=production rvm -S /{project_folder}/script/delayed_job start"
    stop program = "RAILS_ENV=production rvm -S /{project_folder}/script/delayed_job stop"
    

    Here rvm -S command let script run under current rvm ruby environment

    You can try to start daemon with

    $ RAILS_ENV=production rvm -S /{project_folder}/script/delayed_job start
    

    command and if daemon will start (check it with changing last word to 'status') than you have good chances with delayed_job.conf file

    And do not forget to check if pid file had created in tmp/pids/ folder too

提交回复
热议问题