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

Explicitly daemonize when needed. #54

Merged
merged 2 commits into from
Jun 25, 2014

Conversation

crohr
Copy link
Contributor

@crohr crohr commented Jun 25, 2014

First, thanks for the gem, great work!

When trying to integrate with upstart, I think it would be better if the daemonize option were not hardcoded into the puma.rb file. Otherwise, upstart is completely lost and thinks the daemon hasn't started. FYI I also tried using the upstart stanzas expect daemon and expect fork but without success (and it's not recommended anyway).

More generally, I think it makes sense to explicitly daemonize on the command line, instead of forcing it for all peripheral services that may want to reuse the puma.rb config file.

For reference, here is my example upstart config file:

description "Puma Server XYZ"

start on runlevel [2345]
stop on runlevel [06]

setuid deploy
setgid deploy

respawn
respawn limit 10 30

script
  cd /path/to/app/current
  bundle exec puma -C /path/to/app/shared/puma.rb
end script

These small changes would allow upstart and capistrano to cohabit peacefully. Let me know what you think.

When trying to integrate with upstart, it's better if the daemonize option is not hardcoded into the puma.rb file.
@seuros
Copy link
Owner

seuros commented Jun 25, 2014

This is a breaking change, the readme should be updated and post_install message should be set.

@crohr
Copy link
Contributor Author

crohr commented Jun 25, 2014

Thanks for the quick reply. I pushed new changes to set a postinstall and an additional line in the changelog. Is this what you wanted?

Note that it should not break any app that are just using the capistrano tasks to manage their puma processes. It is only breaking for those who have services that reuse the puma.rb file.

@seuros
Copy link
Owner

seuros commented Jun 25, 2014

Yes, that correct.
Thank you for your work. You can use the rubygems version now.

seuros added a commit that referenced this pull request Jun 25, 2014
Explicitly daemonize when needed.
@seuros seuros merged commit 5a11b1e into seuros:master Jun 25, 2014
@crohr
Copy link
Contributor Author

crohr commented Jun 25, 2014

Great, thank you!

@crohr crohr deleted the no-daemonize-in-puma-rb branch June 25, 2014 18:46
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

Successfully merging this pull request may close these issues.

2 participants