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

Follow symlinks to get HUP reloading working #394

Closed
streeter opened this issue Aug 20, 2012 · 5 comments
Closed

Follow symlinks to get HUP reloading working #394

streeter opened this issue Aug 20, 2012 · 5 comments
Milestone

Comments

@streeter
Copy link
Contributor

Based off a discussion thread on the mail list, I'm creating a ticket to track this. What started the discussion was my production setup.

I'm trying to deploy gunicorn 0.14.3 with django 1.4.1 and running into some issues with HUP'ing gunicorn to reload the code.

I've got a deploy setup where I symlink the current release to a directory and then switch the symlink to point to the next release on deploy. I want to send gunicorn a HUP signal to just reload the new code, but this isn't working as gunicorn starts and resolves it's current directory to be the absolute reference on the filesystem. So if the directory layout is like this:

/var/www/
    - current -> releases/<hash1>
    + releases/
        + <hash1>/
        + <hash2>/

However, when gunicorn starts in the directory /var/www/current/, it resolves it to /var/www/releases/hash1/ instead. So even though I switch current to point to hash2, sending a HUP to gunicorn will not pick up the new code.

@rduplain
Copy link
Contributor

rduplain commented Sep 1, 2012

Mailing list discussion thread is here:
http://lists.gunicorn.org/user/0149.html

@sirkonst
Copy link
Collaborator

sirkonst commented Sep 3, 2012

I think the true way to reload code is a graceful restart gunicorn. I use it in my project. HUP signal not for reload code, only for spawn new worker with currect and "stable" version's code.

@benoitc
Copy link
Owner

benoitc commented Oct 15, 2013

Using the new --cwd option should fix it.

@benoitc benoitc closed this as completed Oct 15, 2013
@chuckg
Copy link

chuckg commented Oct 22, 2013

How does --cwd differ from --chdir?

@benoitc
Copy link
Owner

benoitc commented Oct 23, 2013

@chuckg I meant the --chdir option ... I - some times - need more cafe ;)

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

No branches or pull requests

5 participants