yourabi / chef-puma Goto Github PK
View Code? Open in Web Editor NEWChef cookbook to configure Puma
Chef cookbook to configure Puma
This stanza does not work using ubuntu 12.04. unknown stanza
comes from using init-checkconf
.
https://github.com/yourabi/chef-puma/blob/master/templates/default/upstart.erb#L15
I set up a very simple puma deploy, I only set repo_url
and puma_role
. When I tried to deploy, it failed trying to stop puma:
DEBUG[da937ddc] Running /usr/bin/env [ -f ] on 10.0.0.2
DEBUG[da937ddc] Command: [ -f ]
DEBUG[da937ddc] Finished in 0.003 seconds with exit status 0 (successful).
DEBUG[40ba6f3f] Running /usr/bin/env kill -0 $( cat ) on 10.0.0.2
DEBUG[40ba6f3f] Command: kill -0 $( cat )
It seems like the defaults
task is being run?
I noticed this today while using chef-puma. With the following configuration, I'm observing chef-puma creating logrotate config files in /etc/logrotate.d
regardless of the inclusion of logrotate false
.
%w{example-one-com example-two-com}.each do |name|
root_path = "/var/www/#{name}"
current_path = "#{root_path}/current"
shared_path = "#{root_path}/shared"
puma_config name do
owner 'www-data'
group 'www-data'
directory current_path
working_dir current_path
rackup "#{current_path}/config.ru"
puma_directory shared_path
config_path "#{shared_path}/puma.config"
pidfile "#{shared_path}/pids/puma.pid"
state_path "#{shared_path}/pids/puma.state"
bind "unix://#{shared_path}/pids/puma.sock"
control_app_bind "unix://#{shared_path}/pids/pumactl.sock"
logrotate false
monit false
upstart true
end
end
I did some digging in and found this issue on logrotate where a user reports that logrotate ignores the only_if
evaluation because logrotate_app
is implemented as a definition instead of an LWRP. chef-puma attempts to use only_if
on line 163 in definitions/puma_config.rb
.
I put together a fix for the issue here but didn't open a pull request as I was seeing some errors (specifically with foodcritic) when running the test suite with rake
.
I'm not terribly familiar with cookbook development so figured I'd open this issue and get your thoughts.
Thanks!
monit stop will cleanly shutdown Puma however when the system is shutdown Puma can be left in an inconsistent state (sock fd mostly and stale pid file).
Investigate the best way of packaging this with the Cookbook
Idea: one alternative might be to check if PID in pidfile is present, if not call puma_kill.sh first and then start normally.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.