0

I want to supervise my Rails application running on unicorn with monit.

Running following two from shell when logged in as root would fail:

  • "/srv/app/current/config/unicorn.sh start"
  • su -c "/srv/app/current/config/unicorn.sh start" app

What does work is:

  • su -c "/srv/app/current/config/unicorn.sh start" - app

It does not suprise me, I'm using rbenv which requires some alterations in $PATH which I do in .bash_profile. Unfortunately, I can't make it working with monit. I've prepared some script which bases on what I found in Internet:

check process unicorn
  with pidfile /srv/app/shared/pids/unicorn.pid
  start program = "/srv/app/current/config/unicorn.sh start" as uid app and gid app
  stop program = "/srv/app/current/config/unicorn.sh stop" as uid app and gid app
  group www

It looks like .bash_profile is not read in this case — how to change it? Or, alternatively, how to add few directories to $PATH which is used by monit?

Thanks for any help.

1 Answer 1

1

I've just find out that the best thing to do is to make this unicorn.sh with shebang pointing to /bin/bash and set $PATH in the beginning of script.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .