I have an app with a Procfile set to run a shell script, but Heroku will not run the script, stating "Permission denied".
Procfile:web: ./start.sh
start.sh:
#!/usr/bin/env bash
clear;
until node app.js; do
echo "Server crashed with exit code $?. Respawning.." >&2
sleep 1
done
Heroku log:
Starting process with command './start.sh'
bash: ./start.sh: Permission denied
State changed from starting to crashed
Process exited with status 126
For that to work, start.sh
must be executable:
chmod a+x start.sh
If you cannot arrange for that to happen on the machine where the file runs, you can invoke it directly with bash; instead of ./start.sh
, use bash ./start.sh
(or even just bash start.sh
)