Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku: "bash: ./start.sh: Permission denied"

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

like image 313
Nifty255 Avatar asked Feb 14 '15 04:02

Nifty255


1 Answers

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)

like image 52
rici Avatar answered Oct 17 '22 18:10

rici