Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaning up tmp/sockets before starting application #51

Closed
b-a-t opened this issue Oct 16, 2014 · 2 comments
Closed

Cleaning up tmp/sockets before starting application #51

b-a-t opened this issue Oct 16, 2014 · 2 comments

Comments

@b-a-t
Copy link

b-a-t commented Oct 16, 2014

After commiting altered version of the container one of the side effects of such an operation is that socket files are stored as plan files in the diff. One of such files is tmp/unicorn.socket, which prevents unicorn from starting up, as server sees it's not a socket and fails.

The easiest fix to that is to add a clean up into the appStart() function:

--- a/assets/init
+++ b/assets/init
@@ -443,6 +447,10 @@ esac
 chown -R redmine:redmine ${DATA_DIR}/tmp/

 appStart () {
+  # clear pids and sockets
+  rm -f /home/redmine/redmine/tmp/sockets/* /home/redmine/redmine/tmp/pids/*
+  #sudo -u redmine -H bundle exec rake tmp:pids:clear RAILS_ENV=production >/dev/null
+  #sudo -u redmine -H bundle exec rake tmp:sockets:clear RAILS_ENV=production >/dev/null
   # start supervisord
   exec /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
 }
@elderone
Copy link

+1

@sameersbn
Copy link
Owner

@b-a-t @elderone will do. I expected the two rake tasks to have the required effect. Apparently that does not seem to be the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants