# File lib/rbg.rb, line 130
    def fork_worker(id)
      pid = fork do
        # Set process name
        $0="#{config.name}[#{id}]"
        
        # Ending workers on INT is not useful or desirable
        Signal.trap('INT', proc {})
        Signal.trap('HUP', proc {})
        # Restore normal behaviour
        Signal.trap('TERM', proc {Process.exit(0)})
        
        # Execure before_fork code
        if config.after_fork.is_a?(Proc)
          self.config.after_fork.call
        end
        
        if self.config.script.is_a?(String)
          require self.config.script
        elsif self.config.script.is_a?(Proc)
          self.config.script.call
        end
      end
      
      # Print some debug info and save the pid
      logger.info "Spawned #{config.name}[#{id}] (with PID #{pid})"
      STDOUT.flush
      
      # Detach to eliminate Zombie processes later
      Process.detach(pid)
      
      # Save the worker PID into the Parent's child process list
      self.child_processes[id]                    ||= {}
      self.child_processes[id][:pid]              ||= pid
      self.child_processes[id][:respawns]         ||= 0
      self.child_processes[id][:started_at]         = Time.now
    end