0

你好!

我也有钩子,一个用于 pre_start,一个用于 post_start。

  • pre_start开始一个自写的脚本,例如:nohup python foo.py > /dev/null &
  • foo.py像往常一样持续运行的地方。
  • post_start仅用于诊断一切运行正常,它只是调用ps aux并发送有关它的电子邮件。(这是一个带有 shebang 的 Python 脚本)

现在。当我提交并推送某些内容时,重建开始,并以两个 pre_start 和 post_start 脚本之间的无限循环结束:(

他们之间只有一些小消息,我不明白:

remote: Script /var/lib/openshift/5...3/python//virtenv/bin/activate.fish cannot be made relative (it's not a normal script that starts with #!/var/lib/openshift/5...3/python/virtenv/bin/python)
remote: Script /var/lib/openshift/5...3/python//virtenv/bin/activate.csh cannot be made relative (it's not a normal script that starts with #!/var/lib/openshift/5...3/python/virtenv/bin/python)

谢谢你的帮助!:)

4

1 回答 1

0

如我所见,这很正常。你有这么多的弹药筒,你的钩子就会被调用。在我跌倒的 4 次中......我不得不处理这个问题,用后缀重命名我的钩子python-2.7pre_start_python-2.7. 这样,它只运行一次。

这是部署过程的事件日志:

remote: Preparing build for deployment
remote: Deployment id is 4e9628aa
remote: Activating deployment
remote: pre_start called
remote: Starting Cron cartridge
remote: post_start called
remote: pre_start called
remote: Starting MongoDB cartridge
remote: Waiting for mongo to start...
remote: post_start called
remote: pre_start called
remote: Starting RockMongo cartridge
remote: post_start called
remote: Script /var/lib/openshift/5...3/python//virtenv/bin/activate.fish cannot be made relative (it's not a normal script that starts with #!/var/lib/openshift/5...3/python/virtenv/bin/python)
remote: Script /var/lib/openshift/5...3/python//virtenv/bin/activate.csh cannot be made relative (it's not a normal script that starts with #!/var/lib/openshift/5...3/python/virtenv/bin/python)
remote: pre_start called
remote: Starting Python 2.7 cartridge (Apache+mod_wsgi)
remote: Application directory "/" selected as DocumentRoot
remote: Application "wsgi.py" selected as default WSGI entry point
remote: post_start called
remote: -------------------------
remote: Git Post-Receive Result: success
于 2015-10-20T21:50:15.227 回答