cookbook 'unicorn', '~> 3.0.0'
The unicorn cookbook has been deprecated
Author provided reason for deprecation:
The unicorn cookbook has been deprecated and is no longer being maintained by its authors. Use of the unicorn cookbook is no longer recommended.
unicorn (12) Versions 3.0.0 Follow42
Installs and configures unicorn
cookbook 'unicorn', '~> 3.0.0', :supermarket
knife supermarket install unicorn
knife supermarket download unicorn
unicorn Cookbook
Installs and configures unicorn, and provides a definition to manage configuration file for Rack apps running under unicorn.
DEPRECATION NOTICE
This cookbook was originally coded prior to the adoption of bundler and rbenv/rvm. We don't believe that there's a need for installing unicorn into the system ruby in a modern ruby stack. We've chosen to deprecate the cookbook to prevent user confusion. We're open to rethinking this cookbook entirely and if that interests you drop us a line at cookbooks@chef.io
Requirements
Platforms
- Any platform the supports the unicorn gem
Chef Infra Client
- Chef Infra Client 14+
Cookbooks
- none
Definitions
unicorn_config
The unicorn_config definition manages the configuration template for an application running under unicorn.
Parameters
-
listen
- Default is nil. -
working_directory
- Default is nil. -
worker_timeout
- Default is 60. -
preload_app
- Default is false. -
worker_processes
- Number of worker processes to spawn. Default is - 4.
-
unicorn_command_line
- If set, specifies the unicorn commandline to set - in the config file. Usefull when sandboxing your unicorn installation.
-
forked_user
- User to run children as. Default is nil. -
forked_group
- Group to run children as. You must specify aforked_user
- as well to use this attribute. Default is nil.
-
before_exec
- Default is nil. -
before_fork
- Default is nil. -
after_fork
- Default is nil. -
pid
- Pidfile location. Default is nil. -
stderr_path
- Where stderr gets logged. Default is nil. -
stdout_path
- Where stdout gets logged. Default is nil. -
notifies
- How to notify another service if specified. Default is nil. -
owner
- Owner of the template. Default is nil. -
group
- group of the template. Default is nil. -
mode
- mode of the template. Default is nil. -
unicorn_command_line
- Specify the command-line for the unicorn - binary as a string. Populates
Unicorn::HttpServer::START_CTX[0]
. - Default is nil.
-
copy_on_write
- Whether the app should take advantage of REE Copy - On Write feature. Default is false.
-
enable_stats
- Whether the app should have GC profiling enabled - for instrumentation. Default is false.
For more information on copy_on_write
and enable_stats
, see:
- http://www.rubyenterpriseedition.com/faq.html#adapt_apps_for_cow
- https://newrelic.com/docs/ruby/ruby-gc-instrumentation
Respectively.
Examples
Setting some custom attributes in a recipe (this is from Chef's application::unicorn
.
node.default[:unicorn][:worker_timeout] = 60 node.default[:unicorn][:preload_app] = false node.default[:unicorn][:worker_processes] = [node[:cpu][:total].to_i * 4, 8].min node.default[:unicorn][:preload_app] = false node.default[:unicorn][:before_fork] = 'sleep 1' node.default[:unicorn][:port] = '8080' node.set[:unicorn][:options] = { :tcp_nodelay => true, :backlog => 100 } unicorn_config "/etc/unicorn/#{app['id']}.rb" do listen({ node[:unicorn][:port] => node[:unicorn][:options] }) working_directory ::File.join(app['deploy_to'], 'current') worker_timeout node[:unicorn][:worker_timeout] preload_app node[:unicorn][:preload_app] worker_processes node[:unicorn][:worker_processes] before_fork node[:unicorn][:before_fork] end
License & Authors
Author: Cookbook Engineering Team (cookbooks@chef.io)
Copyright: 2008-2015, Chef Software, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
unicorn Cookbook CHANGELOG
This file is used to list changes made in each version of the unicorn cookbook.
v3.0.0 (12-21-2021)
- Require Chef Infra Client 14
- Remove the dependency on build-essential cookbook
- Remove Rake based testing / maintainer file use
- Use a SPDX license in metadata.rb
- Remove legacy Infra Client gating in metadata.rb
- Remove legacy recipe descriptions in metadata.rb
- Update the .rubocop.yml config for the latest cookstyle release
v2.1.2 (02-08-2016)
- Marked this cookbook as deprecated. See the readme for additional information
- Added integration testing in Travis CI with kitchen-docker
- Updated platforms that are tested in the .kitchen.yml file
v2.1.1 (12-14-2015):
- Added a Rakefile for simplified testing
- Added the standard chef .rubocop.yml file and a rubocop_todo.yml file
- Updated the development dependencies in the Gemfile
- Updated contributing and testing docs
- Updated the URLs in the readme for the chef-cookbooks org
- Added maintainers.md and rake task for generating the file from maintainer.toml
- Updated Travis to test using chef-dk
v2.1.0 (09-08-2015):
- Include build-essential in the default recipe to that the necessary build tools will be in place to compile native gem deps for the unicorn gem
- Add testing with Kitchen CI config, basic convergence Chefspec, Travis CI config
- Add rubocop config and resolve warnings
- Add a gitignore, chefignore, Berksfile, and Gemfile to the repo
- Add source_url and issues_url to the metadata
- Better define chef / platform requirements in the readme and add common platforms to the metadata file
- Add testing and cookbook version badges to the readme
- Update all Opscode references to Chef Software
v2.0.0:
- #9 Removes transform to allow for using node attributes for params.
v1.3.0:
Improvement
- [COOK-2470]: Add "user" directive support to Unicorn cookbook
v1.2.2:
- [COOK-2442] - Template uses an ActiveSupport method
v1.2.0:
- [COOK-2229] - Allow specification of unicorn command line in config file
- [COOK-2349] - Add option to include cow and GC stats
- [COOK-2354] - if no listen options are provided for a port, a
- trailing comma is left which causes unicorn to crash
v1.1.0:
- [COOK-857] - Unicorn not quoting listener ports/sockets
- [COOK-1273] - add ability to specify before_exec block
v1.0.0:
- Current public release.
Collaborator Number Metric
3.0.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
3.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
3.0.0 passed this metric
No Binaries Metric
3.0.0 passed this metric
Testing File Metric
3.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
3.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
3.0.0 failed this metric
3.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
3.0.0 passed this metric
No Binaries Metric
3.0.0 passed this metric
Testing File Metric
3.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
3.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
3.0.0 passed this metric
3.0.0 passed this metric
Testing File Metric
3.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
3.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
3.0.0 failed this metric
3.0.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number