bluepill 0.0.12 → 0.0.13
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.
- data/VERSION +1 -1
- data/bluepill.gemspec +1 -1
- data/lib/bluepill/system.rb +10 -10
- metadata +1 -1
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.13
|
data/bluepill.gemspec
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{bluepill}
|
|
8
|
-
s.version = "0.0.
|
|
8
|
+
s.version = "0.0.13"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Arya Asemanfar", "Gary Tsang", "Rohith Ravi"]
|
data/lib/bluepill/system.rb
CHANGED
|
@@ -49,20 +49,20 @@ module Bluepill
|
|
|
49
49
|
else
|
|
50
50
|
# child
|
|
51
51
|
rd.close
|
|
52
|
-
|
|
52
|
+
|
|
53
53
|
drop_privileges(options[:uid], options[:gid])
|
|
54
|
-
|
|
54
|
+
|
|
55
55
|
to_daemonize = lambda do
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
Dir.chdir(ENV["PWD"] = options[:working_dir]) if options[:working_dir]
|
|
57
|
+
::Kernel.exec(cmd)
|
|
58
|
+
exit
|
|
59
|
+
end
|
|
60
|
+
|
|
61
61
|
daemon_id = Daemonize.call_as_daemon(to_daemonize, nil, cmd)
|
|
62
|
-
|
|
62
|
+
|
|
63
63
|
wr.write daemon_id
|
|
64
64
|
wr.close
|
|
65
|
-
|
|
65
|
+
|
|
66
66
|
exit
|
|
67
67
|
end
|
|
68
68
|
end
|
|
@@ -94,7 +94,7 @@ module Bluepill
|
|
|
94
94
|
# grandchild
|
|
95
95
|
drop_privileges(options[:uid], options[:gid])
|
|
96
96
|
|
|
97
|
-
Dir.chdir(options[:working_dir]) if options[:working_dir]
|
|
97
|
+
Dir.chdir(ENV["PWD"] = options[:working_dir]) if options[:working_dir]
|
|
98
98
|
|
|
99
99
|
# close unused fds so ancestors wont hang. This line is the only reason we are not
|
|
100
100
|
# using something like popen3. If this fd is not closed, the .read call on the parent
|