Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've daemon owned that I'd like to have system supervisor manage. The daemon has its own user and, being done up in ruby, it's own rbenv environment. The supervisord conf for the daemon:

[program:hooks]
command=/home/hooks/bin/run.sh
user=hooks
environment=HOME='/home/hooks',USER=hooks,PATH='/home/hooks/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'

where /home/hooks/bin/run.sh looks like:

#!/bin/bash -e                                                                                                                                                 

rbenv init -

cd /home/carehooks/src/
bundle install

thin --timeout 0 --environment 'production' --rackup `pwd`/config.ru --chdir examples/ start

Now, the result:

# supervisorctl start hooks
hooks: ERROR (abnormal termination)

# cat /var/log/supervisor/hooks-stderr---supervisor-e2Myrz.log 
/bin/readlink: missing operand
Try `/bin/readlink --help' for more information.
/home/hooks/bin/run.sh: line 6: bundle: command not found

# cat /var/log/supervisor/hooks-stdout---supervisor-ndpvIv.log 
export PATH="/home/hooks/.rbenv/shims:${PATH}"
source "/home/hooks/.rbenv/libexec/../completions/rbenv.bash"
rbenv rehash 2>/dev/null
function rbenv() {
  command="$1"
  if [ "$#" -gt 0 ]; then
    shift
  fi

  case "$command" in
  shell)
    eval `rbenv "sh-$command" "$@"`;;
  *)
    command rbenv "$command" "$@";;
  esac
}

Is my supervisord configuration at fault, or rbenv? How can I get the two to co-exist?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.