X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=doc%2FMCollective%2FUnixDaemon.html;fp=doc%2FMCollective%2FUnixDaemon.html;h=a72a7f12456576f90ce748b8a3addc13f510060d;hb=7c9314f502cde8daad23b61d10b24a542e04154a;hp=0000000000000000000000000000000000000000;hpb=d1f1649ba43c5cbc43c4beb2380096ba051d646a;p=packages%2Fprecise%2Fmcollective.git diff --git a/doc/MCollective/UnixDaemon.html b/doc/MCollective/UnixDaemon.html new file mode 100644 index 0000000..a72a7f1 --- /dev/null +++ b/doc/MCollective/UnixDaemon.html @@ -0,0 +1,456 @@ + + + +
+ + ++Daemonize the current process +
+ + + ++ # File lib/mcollective/unix_daemon.rb, line 4 + 4: def self.daemonize + 5: fork do + 6: Process.setsid + 7: exit if fork + 8: Dir.chdir('/tmp') + 9: STDIN.reopen('/dev/null') +10: STDOUT.reopen('/dev/null', 'a') +11: STDERR.reopen('/dev/null', 'a') +12: +13: yield +14: end +15: end+
(Not documented)
+ + + ++ # File lib/mcollective/unix_daemon.rb, line 17 +17: def self.daemonize_runner(pid=nil) +18: raise "The Unix Daemonizer can not be used on the Windows Platform" if Util.windows? +19: +20: UnixDaemon.daemonize do +21: if pid +22: begin +23: File.open(pid, 'w') {|f| f.write(Process.pid) } +24: rescue Exception => e +25: end +26: end +27: +28: begin +29: runner = Runner.new(nil) +30: runner.run +31: ensure +32: File.unlink(pid) if pid && File.exist?(pid) +33: end +34: end +35: end+
Disabled; run with --debug to generate this.
+ +Generated with the Darkfish + Rdoc Generator 1.1.6.
+