Sha256: ff216e7fcf68647294baa16720c942c407dabcd5d566c574ebbd799038f7263d

Contents?: true

Size: 608 Bytes

Versions: 133

Compression:

Stored size: 608 Bytes

Contents

module Process

  # This overrides the default version because it is broken if it
  # exists.

  def self.daemon(nochdir=false, noclose=false)
    exit if fork                     # Parent exits, child continues.

    Process.setsid                   # Become session leader.

    exit if fork                     # Zap session leader. See [1].

    Dir.chdir "/" unless nochdir     # Release old working directory.

    if !noclose
      STDIN.reopen File.open("/dev/null", "r")

      null_out = File.open "/dev/null", "w"
      STDOUT.reopen null_out
      STDERR.reopen null_out
    end

    0
  end
end

Version data entries

133 entries across 130 versions & 18 rubygems

Version Path
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.10.beta vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb