All Events Succeeded but flask app not starting
appspec.yml
version: 0.0
os: linux
files:
- source: /testServerRegadv.py
destination: /path to folder in server/python
hooks:
ApplicationStart:
- location: scripts/start_server.sh
timeout: 300
runas: root
ApplicationStop:
- location: scripts/stop_server.sh
timeout: 300
runas: root
start_server.sh
#!/bin/bash
echo "In start server" >>results.txt 2> errors.log &
python /path in server/python/testServerRegadv.py > results.txt 2> errors.log &
stop_server.sh
isExistApp = `lsof -t -i:1515`
if [[ -n $isExistApp ]]; then
kill -9 $(lsof -t -i:1515)
fi
Also I am using code commit for storing the code and before pushing to aws code-commit I am executing chmod +x scripts/ * to make the scripts executable.