about summary refs log tree commit homepage
path: root/lib/yahns/config.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/yahns/config.rb')
-rw-r--r--lib/yahns/config.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/yahns/config.rb b/lib/yahns/config.rb
index e48ba4e..9a63803 100644
--- a/lib/yahns/config.rb
+++ b/lib/yahns/config.rb
@@ -99,6 +99,11 @@ class Yahns::Config # :nodoc:
     )
   end
 
+  def before_exec(&blk)
+    var = _check_in_block(nil, :before_exec)
+    @set[var] = (block_given? ? blk : args[0])
+  end
+
   def _add_hook(pfx, var, my_proc)
     case my_proc
     when Proc
@@ -397,7 +402,7 @@ class Yahns::Config # :nodoc:
       io.sync = true
     end
 
-    [ :logger, :pid, :worker_processes, :user, :shutdown_timeout,
+    [ :logger, :pid, :worker_processes, :user, :shutdown_timeout, :before_exec,
       :worker_atfork_prepare, :worker_atfork_parent, :worker_atfork_child
     ].each do |var|
       val = @set[var]