You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2.5 KiB

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