-
Notifications
You must be signed in to change notification settings - Fork 140
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
Fix unicorn pid auto-detection behavior #88
base: master
Are you sure you want to change the base?
Conversation
* run auto-detection on remote * convert relative path to absolute * use `unicorn -e` instead of `unicorn -c` with Tempfile
I'm looking at it - please don't merge yet. |
this works perfectly with my rails app. |
unicorn_default_pid | ||
end | ||
end | ||
_cset(:unicorn_pid) { extract_pid_file || unicorn_default_pid } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not keen on this - why did you remove the error logging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it's just mistake. I will revert it.
Thanks for the work on this but IMHO it needs more work before merging. One core problem is that the commit message does not explain the motivation for the changes it lists, which makes it hard for us to collaboratively arrive at a consensus for the right fix, leaving us in guesswork territory. I'd much prefer to know that we definitely fixed the issue in the right way, rather than rely on empirical "well it seems to work OK for me" data. |
Thanks for your feedback and sorry for my less explanation. Let me explain what this pull request tries to fix and why. pid auto-detection in auto-detection runs on local environmentAs you know the auto-detection runs on local machine in If To fix the case above, auto-detection should run on server-side. Relative pathIf relative path is specified to To fix this relative path problem, there're two approaches I think:
I picked the first approach because I think it's more readable when reading log. I rebase and add more detailed commit logs when the discussion reach conclusion. |
Thanks a lot for the explanation and replies! This is beginning to make more sense now, but we're not there yet. For example one of the issues (as I already commented) is failure to find the unicorn config file. And I'm worried about this previous comment but I can't remember the exact details. |
Please could you give some examples of this? |
I ran into the same problem. My unicorn config uses Dir.home to set app_path and sets pid file path using concatenation. Like
I used k2nr version and it was promising, but in his commits he doesn't run So I've rebased k2nr commits on top of current master and added a quick fix. You can review it here amw/capistrano-unicorn@1bd81f3. Now I get a correct output from
Note that I can't simply change my pid definition to use relative path like
when not in a proper working directory of the app. I believe checking pid path on the server is well worth the second request and tad slower deploy (additional hit to the server and additional |
unicorn -e
instead ofunicorn -c
with TempfileThis fixes #85