From a824b346dabe9c24f63c6764d0f9629ff2daf9eb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 10 Feb 2009 12:06:25 -0800 Subject: add hot_config_file config parameter This allows changing certain variables without restarting the master process or code reload. Currently, only the following variables are supported: @timeout, @nr_workers, @hot_config_file. Any other config changes will/should require re-executing the running binary. This config file is run through eval(); so it really users plenty of rope to hang themselves with. Of course, it requires valid Ruby syntax: ------------------------- 8< ------------------------ @nr_workers = 8 @timeout = 15 @hot_config_file = "/var/tmp/new_hot_config_file" ------------------------- 8< ------------------------ Lowering the timeout will trigger all existing workers to be gracefully stopped and restarted. This file is loaded at startup, and overrides any config settings that may already be loaded. --- bin/unicorn-hello-world | 1 + 1 file changed, 1 insertion(+) (limited to 'bin') diff --git a/bin/unicorn-hello-world b/bin/unicorn-hello-world index 2aba773..8d77ea1 100755 --- a/bin/unicorn-hello-world +++ b/bin/unicorn-hello-world @@ -22,5 +22,6 @@ end # make sure this hash is the last statement, as this is eval-ed by unicorn { # :listeners => %w(0.0.0.0:8080 127.0.0.1:7701 /tmp/test.sock), + # :hot_config_file => "/tmp/hot_config", :app => HelloWorld.new, } -- cgit v1.2.3-24-ge0c7