如何执行.sh文件以在Monit中启动进程?

时间:2016-08-04 08:55:09

标签: ruby-on-rails linux bash sh monit

所以我有puma_start_staging.sh个文件。如果我从终端

执行该文件

. /home/deploy/puma_start_staging.sh

一切都好。但是monit无法执行该文件。 这是我的配置:

check process puma_staging with pidfile /home/deploy/apps/staging/shared/tmp/pids/puma.pid
start program = "/bin/bash -c '. /home/deploy/puma_start_staging.sh'"
stop  program = "/bin/bash -c 'kill `cat /home/deploy/apps/staging/shared/tmp/pids/puma.pid`'"

我在monit.log中得到这个

[EEST Aug  4 10:56:10] info     : 'puma_staging' start: /bin/bash
[EEST Aug  4 10:56:40] error    : 'puma_staging' failed to start
[EEST Aug  4 10:56:40] info     : 'puma_staging' start action done

我做错了什么?

0 个答案:

没有答案