Description of problem:
If the end user deletes the tmp dir under $OPENSHIFT_REPO_DIR/tmp then an application restart will fail because the command below fails:
Should check the code in post-deploy as well since it also attempts to touch this file.
We shouldn't assume that directory is still there since it is underneath their repo dir.
Occurs in PROD when and tries to restart their app. Recreating the tmp dir allows app to be restarted again.
Steps to Reproduce:
1. Create a ruby app
2. ssh in and delete app-root/repo/tmp
3. Restart the app
500 error with these messages (as reported by site in new relic):
Error: Failed to execute: 'control restart' for /var/lib/openshift/<id>/rubyrestarting Ruby carttouch: cannot touch `/var/lib/openshift/<id>/app-root/runtime/repo//tmp/restart.txt': No such file or directory -- Unable to complete the requested operation due to: Failed to correctly execute all parallel operations - ["RestartCompOp"]
The application should restart.
If tmp isn't there we should fall back to the standard apache restart.
Commit pushed to master at https://github.com/openshift/origin-server
Bug 1052276 - Check if tmp/ directory exists before ruby restart
Fyi, we are doing the full apache restart anyway. I think the reason why is to pick up environment variables changes (performance/passenv). In that case I think it does not even make a sense to touch the restart.txt.
test ruby-1.8 and ruby-1.9 on devenv_4224, after ssh into app and delete app-root/repo/tmp, app can restart normally.
[root@Daphne test]# rhc app restart ruby19
Move to verified.