Sha256: 3284fe71c2327dd95ea67005b3eb4b939f7397505fc77cad69d3d5ebb110088e
Contents?: true
Size: 1022 Bytes
Versions: 8
Compression:
Stored size: 1022 Bytes
Contents
require 'daemons' module DaemonKit # Class responsible for making the daemons run and keep them running. class Application class << self # Run the file as a daemon def run( file ) raise DaemonNotFound.new( file ) unless File.exist?( file ) app_name = DaemonKit.configuration.daemon_name || File.basename( file ) options = { :backtrace => true, :log_output => true, :app_name => app_name } options[:dir_mode] = DaemonKit.configuration.dir_mode || :normal options[:dir] = DaemonKit.configuration.dir || "log" options[:multiple] = DaemonKit.configuration.multiple options[:force_kill_wait] = DaemonKit.configuration.force_kill_wait if DaemonKit.configuration.force_kill_wait Daemons.run( file, options ) end # Call this from inside a daemonized process to complete the # initialization process def running! DaemonKit::Initializer.continue! end end end end
Version data entries
8 entries across 8 versions & 2 rubygems