Amazon web services aws代码部署长期运行的进程

Amazon web services aws代码部署长期运行的进程,amazon-web-services,aws-code-deploy,long-running-processes,Amazon Web Services,Aws Code Deploy,Long Running Processes,正在应用Aws codedeploy。 appspec文件如下所示 version: 0.0 os: linux files: - source: script/install-file.sh destination: /home/ hooks: AfterInstall: - location: script/install-file.sh timeout: 120 runas: root ApplicationStart: - lo

正在应用Aws codedeploy。 appspec文件如下所示

version: 0.0
os: linux
files:
  - source: script/install-file.sh
    destination: /home/
hooks:
  AfterInstall:
    - location: script/install-file.sh
      timeout: 120
      runas: root
  ApplicationStart:
    - location: script/start-file.sh
      timeout: 120
      runas: root
我尝试成功,直到安装后。 它仍在applicationStart中挂起。 安装后安装已安装的Java文件并设置权限

chmod 755 ${file_HOME}/bin/install_api
chmod 755 ${file_HOME}/bin/install_web
已设置自动运行

/bin/cp ${file_HOME}/bin/install_api /etc/init.d
/bin/cp ${file_HOME}/bin/install_web /etc/init.d

Chkconfig --add ib_api
Chkconfig --add ib_web
start-file.sh在下面

#!/bin/bash
# start InnerBeans
sudo service install_api start &
sleep 5
sudo service install_web start &
sleep 5

调用LifeCycleEvent脚本内的后台进程或守护进程时,codedeploy agent版本官方_1.0-1.1106_rpm将保持挂起状态,直到70分钟超时。 首先,尝试删除&如下所示:

#!/bin/bash
# start InnerBeans
sudo service install_api start
#sleep 5
sudo service install_web start
#sleep 5
如果仍然失败,您可能在init脚本中有后台进程或后台进程,因此需要重定向输出stdout和stderr

尝试:

第二种方法对我有效。 我在这里找到了解决方案: 这里呢

您能提供更多详细信息吗?错误/结果是什么?您可以检查部署日志以查看目前运行的codedeploy吗?以下是如何找到它们:
#!/bin/bash
# start InnerBeans
sudo service install_api start > /dev/null 2>&1
#sleep 5
sudo service install_web start > /dev/null 2>&1
#sleep 5