Code Deploy ApplicationStart gets stuck on pending using node

此生再无相见时 提交于 2019-12-04 11:21:39
Chris

The command node /app.js does not run in background but in foreground, therefor the start.sh script is never finished.

See this thread for more info about running node in background Node.js as a background service

The CodeDeploy agent is waiting for the script it launched to return an exit code and to close stdout and stderr. To start a process in the background and detach it from the host agent so it can run as a daemon, try:

node /app.js > /dev/null 2> /dev/null < /dev/null &

Note: you'll want to modify your program to write to a log file instead of the console, since daemons usually don't have a console to write to (as it is in this version).

See the official docs here: http://docs.aws.amazon.com/codedeploy/latest/userguide/troubleshooting.html#troubleshooting-long-running-processes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!