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.1.9 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.8 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.7 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.6 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-newrelic-1.2.0 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.3.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.5 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.4 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.3 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-scalyr-0.1.2 vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-filter-device_detection-1.0.7-java vendor/bundle/jruby/1.9/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
mrcooper-logstash-output-azuresearch-0.2.2 vendor/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-output-icinga-1.1.0 vendor/jruby/2.3.0/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/puma-2.16.0-java/lib/puma/daemon_ext.rb