I'm running supervisord to execute gunicorn. My problem is when my script contains CURR_DIR=`pwd -P` and run the script via supervisord, it STOPS the process. My script is located in /var/www/conf
and I expect `pwd P` to return /var/www/conf
when I run the script. I tried PWD and that doesn't return /var/www/conf
either. The `pwd -P` works when I run the script outside of supervisord.
But if I hardcode CURR_DIR=/some/dir then supervisord runs the script no problem.
Here's my script
#!/bin/bash
NAME=myproj
GUNICORN_EXEC=/home/user/.virtualenvs/tscoop/bin/gunicorn
CURRENT_DIR=`pwd -P` # does not work: causes "STOPPED" error in supervisord
CURRENT_DIR=/var/www/conf # works ok
export GUNICORN_CONF=${CURRENT_DIR}/gunicorn.conf
echo "Starting $NAME"
exec $GUNICORN_EXEC -c $GUNICORN_CONF
exit 0
Here's the error message I get from supervisorctl shell:
supervisor> status
myscript STOPPED Aug 27 09:57 PM
How can I make it so that I can run supervisord can run the above script?