dorothy2 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,25 +0,0 @@
1
- module Process
2
- # Supply daemon for pre ruby 1.9
3
- # Adapted from lib/active_support/core_ext/process/daemon.rb
4
- def self.daemon(nochdir = nil, noclose = nil)
5
- exit! if fork # Parent exits, child continues.
6
- Process.setsid # Become session leader.
7
- exit! if fork # Zap session leader. See [1].
8
-
9
- unless nochdir
10
- Dir.chdir "/" # Release old working directory.
11
- end
12
-
13
- unless noclose
14
- STDIN.reopen "/dev/null" # Free file descriptors and
15
- STDOUT.reopen "/dev/null", "a" # point them somewhere sensible.
16
- STDERR.reopen '/dev/null', 'a'
17
- end
18
-
19
- trap("TERM") { exit }
20
-
21
- return 0
22
-
23
- end unless self.respond_to? :daemon
24
- end
25
-