刚开始学习 unicorn, 由于对 unix 不够了解,有两个疑问请大家指点迷津,谢谢啦。
pid 是进程的惟一 id, 如果我的 vps 上同时运行两个应用,unicorn 就有两个 pid 了?
pid 是 unicorn_init.sh 这个脚本产生的吗,然后 unicorn.rb 拿来用?
https://github.com/samqiu/samqiu.com/blob/master/config/unicorn_init.sh#L16
TIMEOUT=${TIMEOUT-60}
APP_ROOT=/data/web/com.samqiu/current
PID=$APP_ROOT/tmp/pids/unicorn.pid
CMD="cd $APP_ROOT; bundle exec unicorn -D -c $APP_ROOT/config/unicorn.rb -E production"
AS_USER=hola
set -u
......
https://github.com/samqiu/samqiu.com/blob/master/config/unicorn.rb#L3
root = '/data/web/com.samqiu/current'
working_directory root
pid "#{root}/tmp/pids/unicorn.pid"
stderr_path "#{root}/log/unicorn.log"
stdout_path "#{root}/log/unicorn.log"
listen '/tmp/unicorn.samqiu.sock'
worker_processes 4
timeout 30
preload_app true
before_fork do |server, worker|
......