Merge pull request #4125 from nashby/remove-process-daemon

remove Proces.daemon from core_ext
This commit is contained in:
José Valim 2011-12-21 22:10:32 -08:00
commit 667d7aa61d
4 changed files with 0 additions and 32 deletions

View File

@ -1 +0,0 @@
require 'active_support/core_ext/process/daemon'

View File

@ -1,23 +0,0 @@
module Process
def self.daemon(nochdir = nil, noclose = nil)
exit if fork # Parent exits, child continues.
Process.setsid # Become session leader.
exit if fork # Zap session leader. See [1].
unless nochdir
Dir.chdir "/" # Release old working directory.
end
File.umask 0000 # Ensure sensible umask. Adjust as needed.
unless noclose
STDIN.reopen "/dev/null" # Free file descriptors and
STDOUT.reopen "/dev/null", "a" # point them somewhere sensible.
STDERR.reopen '/dev/null', 'a'
end
trap("TERM") { exit }
return 0
end unless respond_to?(:daemon)
end

View File

@ -4,7 +4,6 @@
# Date next_year, next_month
# DateTime to_date, to_datetime, xmlschema
# Enumerable group_by, none?
# Process Process.daemon
# REXML security fix
# String ord
# Time to_date, to_time, to_datetime
@ -12,7 +11,6 @@ require 'active_support'
require 'active_support/core_ext/date/calculations'
require 'active_support/core_ext/date_time/conversions'
require 'active_support/core_ext/enumerable'
require 'active_support/core_ext/process/daemon'
require 'active_support/core_ext/string/conversions'
require 'active_support/core_ext/string/interpolation'
require 'active_support/core_ext/string/encoding'

View File

@ -3479,12 +3479,6 @@ Time.utc_time(1582, 10, 3) + 5.days
# => Mon Oct 18 00:00:00 UTC 1582
</ruby>
h3. Extensions to +Process+
h4. +daemon+
Ruby 1.9 provides +Process.daemon+, and Active Support defines it for previous versions. It accepts the same two arguments, whether it should chdir to the root directory (default, true), and whether it should inherit the standard file descriptors from the parent (default, false).
h3. Extensions to +File+
h4. +atomic_write+