Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Chef Recipe to control Unicorn Servers
Ruby Shell
Branch: master
Failed to load latest commit information.
attributes First commit
files/default Readme updated, some tweaks around unicorn_rails and a small user bugfix
recipes Readme updated, some tweaks around unicorn_rails and a small user bugfix
metadata.rb move unicorn_rack to shell, bump version

unicorn2: Control processes running the unicorn server software

One recipe at this time -- unicorn::default. This recipe:

  • installs a unicorn_rack service meant to manage several unicorn services (see more below)
  • configures any hosts in the /etc/default/unicorn.json file from databags (see examples) and node configuration.
  • restarts the service if the above has changed in any way.

The unicorn_rack script

This script lives in /etc/init.d/unicorn_rack, and is installed as service. The script itself takes two arguments: the directive (stop, start, restart, reload) and the name of the app. If the name of the app is omitted all apps will recieve the actions taken for the directive.

databags and the unicorn.conf file

The /etc/unicorn.conf file is generated by the recipe, and looks a bit like this:


The key is the path to the application, it will be started from that directory.

Databags and node configuration are used to generate this file. Instead of mimicing the structure for the init script, we've provided something a little more streamlined:

  "id": "jsonip",
  "path": "/www/jsonip",
  "bin": "unicorn",
  "config_path": "/www/jsonip/config/unicorn.rb",
  "hosts": [ "coffee" ]

Where hosts is an array of node names, and the path is the key of the data structure above. Note that node configuration looks exactly the same and the key for the node and the databag name searched are both applications.

NOTE: For those of you using the older cookbook with the unicorn.json file, this will be removed on the next run after this cookbook is uploaded and replaced by the /etc/unicorn.conf file.

User accounts (aka BUGS)

The recipes expect a rails user and group to exist. It creates it for you.


  • Fork the project
  • Make your edits
  • Be sure to not change anything in metadata.rb without prior permission.
  • Send a pull request.


Erik Hollensbe

Something went wrong with that request. Please try again.