Skip to content

Instantly share code, notes, and snippets.

View unicorn.rb
app_name = "ldl-website"
root = "/var/www/#{app_name}/current"
pid "#{root}/tmp/pids/unicorn.pid"
stderr_path "#{root}/log/unicorn.error.log"
stdout_path "#{root}/log/unicorn.access.log"
listen "/tmp/unicorn.#{app_name}.sock", :backlog => 2048
preload_app true
View gist:773768c226d8c2613d0e18827db1c624
app_name = "ldl-website"
root = "/var/www/#{app_name}/current"
pid "#{root}/tmp/pids/unicorn.pid"
stderr_path "#{root}/log/unicorn.error.log"
stdout_path "#{root}/log/unicorn.access.log"
listen "/tmp/unicorn.#{app_name}.sock", :backlog => 2048
preload_app true
View unicorn.sh
#!/bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Manage unicorn server
# Description: Start, stop, restart unicorn server for a specific application.
### END INIT INFO