0

can someone shed some clues as to why, when i run this command manually on terminal:

/bin/bash -c 'cd /home/david/live && bundle exec ruby /home/david/live/api/goliath.rb -sv -e prod'

its going to fire my server just fine - but when its on monitrc like so:

start program = "/bin/bash -c 'cd /home/david/live && bundle exec ruby /home/david/live/api/goliath.rb -sv -e prod'"

its just going to repeatedly fail to start / execute that command line

[UTC Sep 17 01:00:25] error : 'goliath' process is not running [UTC Sep 17 01:00:25] info : 'goliath' trying to restart [UTC Sep 17 01:00:25] info : 'goliath' start: /bin/bash

David
  • 167
  • 1
  • 1
  • 8

1 Answers1

0

You might need to specify UID and GID as monit runs as root.

check process myserver 
  with pidfile "/home/path/to/myserver.pid"
  start program = "/bin/bash -c 'cd /home/david/live && bundle exec ruby /home/david/live/api/goliath.rb -sv -e prod'"
    as uid myserver_uid and gid myserver_gid

To debug, you could try to output to a file and check this file to have more details.

check process myserver 
  with pidfile "/home/path/to/myserver.pid"
  start program = "/bin/bash -c 'cd /home/david/live && bundle exec ruby /home/david/live/api/goliath.rb -sv -e prod' >> /tmp/myserver.log 2>&1"
    as uid myserver_uid and gid myserver_gid
Pierre Ozoux
  • 215
  • 2
  • 5