HEX
Server: Apache
System: Linux vpshost0650.publiccloud.com.br 4.4.79-grsec-1.lc.x86_64 #1 SMP Wed Aug 2 14:18:21 -03 2017 x86_64
User: bandeirantesbomb3 (10068)
PHP: 8.0.7
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //opt/puppetlabs/puppet/lib/ruby/vendor_ruby/mcollective/windows_daemon.rb
require 'win32/daemon'

module MCollective
  class WindowsDaemon < Win32::Daemon

    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

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

      @runner = Runner.new(nil)
      @runner.main_loop

      # On shut down there may be threads outside of the runner's context that are
      # in a sleeping state, causing the stop action to wait for them to cleanly exit.
      # We get around this by iterating the list of threads and killing everything that
      # isn't the main thread, letting us shut down cleanly.
      Thread.list.each do |t|
        if t != Thread.current
          t.kill
        end
      end
    end

    def service_stop
      Log.info("Windows service stopping")
      @runner.stop
    end

    def service_pause
      Log.info("Pausing MCollective Windows server")
      @runner.pause
    end

    def service_resume
      Log.info("Resuming MCollective Windows server")
      @runner.resume
    end
  end
end