From fd5844b2baef6c1acaca9ca1eca0509e3a4f840d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 29 Oct 2013 00:02:56 +0000 Subject: implement user switching This was documented (incorrectly) and not implemented for either the master/worker or single process cases. Implement and test all (with mocks, so not fully-tested). --- lib/yahns/config.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/yahns/config.rb') diff --git a/lib/yahns/config.rb b/lib/yahns/config.rb index 6d8945a..ebc3bda 100644 --- a/lib/yahns/config.rb +++ b/lib/yahns/config.rb @@ -158,7 +158,7 @@ class Yahns::Config # :nodoc: # if the Worker#user method is not called in the after_fork hooks # +group+ is optional and will not change if unspecified. def user(user, group = nil) - var = :user + var = _check_in_block(nil, :user) @block and raise "#{var} is not valid inside #{@block.type}" # raises ArgumentError on invalid user/group Etc.getpwnam(user) @@ -385,7 +385,7 @@ class Yahns::Config # :nodoc: io.sync = true end - [ :logger, :pid, :worker_processes, + [ :logger, :pid, :worker_processes, :user, :worker_atfork_prepare, :worker_atfork_parent, :worker_atfork_child ].each do |var| val = @set[var] -- cgit v1.2.3-24-ge0c7