configurator: reloading with unset values restores default
commitcb2c86aaa692c02f0e1810facfe244f28ddb36ae
authorEric Wong <normalperson@yhbt.net>
Wed, 27 Oct 2010 20:51:12 +0000 (27 13:51 -0700)
committerEric Wong <normalperson@yhbt.net>
Wed, 27 Oct 2010 21:14:09 +0000 (27 21:14 +0000)
tree00c3ebf0c7602c5f4c3b9b54cd104d5c305cc8da
parent19b0ac826b9afd283f4cf5c57d554d20f24d2b46
configurator: reloading with unset values restores default

If a configuration directive is set at startup and later
unset, it correctly restores the original default value
as if it had never been set in the first place.

This applies to the majority of the configuration values with
a few exceptions:

* This only applies to stderr_path and stdout_path when
  daemonized (the usual case, they'll be redirected to
  "/dev/null").  When NOT daemonized, we cannot easily redirect
  back to the original stdout/stderr destinations.

* Unsetting working_directory does not restore the
  original working directory where Unicorn was started.
  As far as we can tell unsetting this after setting it is
  rarely desirable and greatly increases the probability of
  user error.
(cherry picked from commit 51b2b90284000aee8d79b37a5406173c45ae212d)
lib/unicorn/configurator.rb
t/t0012-reload-empty-config.sh [new file with mode: 0755]