Contains a namespace with methods for administrating the unicorn server through capistrano recipes.
The gem gives you access to the followig methods within the
unicorn.startwill start the unicorn server in demonized form on port 3000 (default) with the config file placed in app/config/unicorn.rb.
unicorn.stopwill stop the unicorn server.
unicorn.restartrestarts the unicorn server by moving the old one to .pid.oldbin and running a
unicorn.cleanupwill remove the master and worker processes associated with the .pid.oldbin file.
If you'r having trouble targeting the correct namespace you can alternatively run the commands prepended with a
top. so it becomes e.g.
It also relies on the
current_release variable beeing present. This is part of capistrano's standard deploy schema, so there should be no problems.
You can customize the gems behavior by setting any (or all) of the following options within capistrano's configuration:
rails_envsets the environment that the server will run in. Defaults to
unicorn_pidindicates the path for the pid file. Defaults to shared/pids/unicorn.pid.
unicorn_old_pidcontains the pid for the old server. Defaults to shared/pids/unicorn.pid.oldbin.
unicorn_configthe path to the unicorn config file. Defaults to /path/to/your/app/config/unicorn.rb.
unicorn_portdefines the port that unicorn should listen on. Defaults to 3000.
use_bundlerdefines if unicorn should be started through bundler. Defaults to true