Class: MCollective::WindowsDaemon

Inherits:
Win32::Daemon
  • Object
show all
Defined in:
lib/mcollective/windows_daemon.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.daemonize_runner(pid = nil) ⇒ Object



5
6
7
8
9
10
# File 'lib/mcollective/windows_daemon.rb', line 5

def self.daemonize_runner(pid=nil)
  raise "Writing pid files are not supported on the Windows Platform" if pid
  raise "The Windows Daemonizer should only be used on the Windows Platform" unless Util.windows?

  WindowsDaemon.mainloop
end

Instance Method Details

#service_mainObject



12
13
14
15
16
17
# File 'lib/mcollective/windows_daemon.rb', line 12

def service_main
  Log.debug("Starting Windows Service Daemon")

  runner = Runner.new(nil)
  runner.run
end

#service_stopObject



19
20
21
22
23
# File 'lib/mcollective/windows_daemon.rb', line 19

def service_stop
  Log.info("Windows service stopping")
  PluginManager["connector_plugin"].disconnect
  exit! 0
end