{"issue":{"pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"state":"open","user":{"avatar_url":"https://secure.gravatar.com/avatar/e0ed39dc4ab81e6c35f2681503b7c62a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"e0ed39dc4ab81e6c35f2681503b7c62a","url":"https://api.github.com/users/blt","login":"blt","id":3579},"milestone":null,"labels":[],"updated_at":"2011-11-09T16:02:08Z","assignee":null,"comments":0,"closed_at":null,"url":"https://api.github.com/repos/sstephenson/rbenv/issues/141","body":"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:\r\n\r\n    [program:hooks]\r\n    command=/home/hooks/bin/run.sh\r\n    user=hooks\r\n    environment=HOME='/home/hooks',USER=hooks,PATH='/home/hooks/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'\r\n\r\n\r\nwhere `/home/hooks/bin/run.sh` looks like:\r\n\r\n    #!/bin/bash -e                                                                                                                                                 \r\n    \r\n    rbenv init -\r\n    \r\n    cd /home/carehooks/src/\r\n    bundle install\r\n    \r\n    thin --timeout 0 --environment 'production' --rackup `pwd`/config.ru --chdir examples/ start\r\n\r\nNow, the result:\r\n\r\n    # supervisorctl start hooks\r\n    hooks: ERROR (abnormal termination)\r\n    \r\n    # cat /var/log/supervisor/hooks-stderr---supervisor-e2Myrz.log \r\n    /bin/readlink: missing operand\r\n    Try `/bin/readlink --help' for more information.\r\n    /home/hooks/bin/run.sh: line 6: bundle: command not found\r\n    \r\n    # cat /var/log/supervisor/hooks-stdout---supervisor-ndpvIv.log \r\n    export PATH=\"/home/hooks/.rbenv/shims:${PATH}\"\r\n    source \"/home/hooks/.rbenv/libexec/../completions/rbenv.bash\"\r\n    rbenv rehash 2>/dev/null\r\n    function rbenv() {\r\n      command=\"$1\"\r\n      if [ \"$#\" -gt 0 ]; then\r\n        shift\r\n      fi\r\n    \r\n      case \"$command\" in\r\n      shell)\r\n        eval `rbenv \"sh-$command\" \"$@\"`;;\r\n      *)\r\n        command rbenv \"$command\" \"$@\";;\r\n      esac\r\n    }\r\n\r\nIs my supervisord configuration at fault, or rbenv? How can I get the two to co-exist?\r\n\r\n---\r\n\r\nDuplicated at ServerFault: http://serverfault.com/q/329349/67165","html_url":"https://github.com/sstephenson/rbenv/issues/141","title":"Why won't rbenv co-exist with supervisord? ","number":141,"id":2187561,"created_at":"2011-11-09T16:02:08Z"},"action":"opened"}