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
wendell-puma-2.9.2 lib/puma/daemon_ext.rb
rsense-server-0.5.18 vendor/gems/puma-2.8.2-java/lib/puma/daemon_ext.rb
puma-2.9.2-java lib/puma/daemon_ext.rb
puma-2.9.2 lib/puma/daemon_ext.rb
puma-2.9.1-java lib/puma/daemon_ext.rb
puma-2.9.1 lib/puma/daemon_ext.rb
puma-2.9.0-java lib/puma/daemon_ext.rb
puma-2.9.0 lib/puma/daemon_ext.rb
rsense-server-0.5.17 vendor/gems/puma-2.8.2-java/lib/puma/daemon_ext.rb
rsense-server-0.5.16 vendor/gems/puma-2.8.2-java/lib/puma/daemon_ext.rb
rsense-server-0.5.15 vendor/gems/puma-2.8.2-java/lib/puma/daemon_ext.rb
rsense-server-0.5.14 vendor/gems/puma-2.8.2-java/lib/puma/daemon_ext.rb
rsense-server-0.5.13 vendor/gems/puma-2.8.2-java/lib/puma/daemon_ext.rb
rsense-server-0.5.12 vendor/gems/puma-2.8.2-java/lib/puma/daemon_ext.rb
rsense-server-0.5.11 vendor/gems/puma-2.8.2-java/lib/puma/daemon_ext.rb
rsense-server-0.5.10 vendor/gems/puma-2.8.2-java/lib/puma/daemon_ext.rb
rsense-server-0.5.9 vendor/gems/puma-2.8.2-java/lib/puma/daemon_ext.rb
rsense-server-0.5.8 vendor/gems/puma-2.8.2-java/lib/puma/daemon_ext.rb
rsense-server-0.5.7 vendor/gems/puma-2.8.2-java/lib/puma/daemon_ext.rb
rsense-server-0.5.6 vendor/gems/puma-2.8.2-java/lib/puma/daemon_ext.rb