ruby on rails - How should I manage the path to unicorn pid file on production? -


i trying rails 4+ ruby 2.0 depployment vps on digitalocean. using unicorn + capistrano stack.

in local setup have file in config/unicorn.rb:

app_root =  file.expand_path("../..", __file__)  working_directory app_root pid "#{app_root}/tmp/unicorn.pid" worker_processes 2  preload_app true  listen "/tmp/unicorn.sock" timeout 30  stdout_path "#{app_root}/log/unicorn.log" stderr_path "#{app_root}/log/unicorn.log" 

now questions are:

  1. should checking file git version control? or
  2. should have separate unicorn.rb on production server pointing pid path say, /home/deploy/#{myapp}/tmp/unicorn.pid?

i confused how manage consistent paths, guess. please

the simplest way manage paths differ between environments via environment variables. eg: env['pids']...

from unicorn config file above, pids going dumped #{app_root}/tmp, no matter environment...

check out foreman , in particular upstart export (if you're on ubuntu) - (introducing foreman)


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -