zeus 0.11.2 → 0.12.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/build/zeus-darwin-amd64 +0 -0
- data/build/zeus-linux-386 +0 -0
- data/build/zeus-linux-amd64 +0 -0
- data/lib/zeus.rb +19 -20
- metadata +5 -5
data/build/zeus-darwin-amd64
CHANGED
Binary file
|
data/build/zeus-linux-386
CHANGED
Binary file
|
data/build/zeus-linux-amd64
CHANGED
Binary file
|
data/lib/zeus.rb
CHANGED
@@ -11,8 +11,7 @@ module Zeus
|
|
11
11
|
end
|
12
12
|
|
13
13
|
class << self
|
14
|
-
attr_accessor :plan
|
15
|
-
attr_accessor :dummy_tty
|
14
|
+
attr_accessor :plan, :dummy_tty, :master_socket
|
16
15
|
|
17
16
|
# this is totally asinine, but readline gets super confused when it's
|
18
17
|
# required at a time when stdin or stdout is not connected to a TTY,
|
@@ -30,12 +29,18 @@ module Zeus
|
|
30
29
|
STDOUT.reopen(dummy_tty)
|
31
30
|
end
|
32
31
|
|
32
|
+
def setup_master_socket!
|
33
|
+
return master_socket if master_socket
|
34
|
+
|
35
|
+
fd = ENV['ZEUS_MASTER_FD'].to_i
|
36
|
+
self.master_socket = UNIXSocket.for_fd(fd)
|
37
|
+
end
|
38
|
+
|
33
39
|
def go(identifier=:boot)
|
34
|
-
setup_dummy_tty!
|
35
40
|
$0 = "zeus slave: #{identifier}"
|
36
|
-
|
37
|
-
|
38
|
-
master =
|
41
|
+
|
42
|
+
setup_dummy_tty!
|
43
|
+
master = setup_master_socket!
|
39
44
|
|
40
45
|
# I need to give the master a way to talk to me exclusively
|
41
46
|
local, remote = UNIXSocket.pair(Socket::SOCK_STREAM)
|
@@ -78,17 +83,12 @@ module Zeus
|
|
78
83
|
remote.close
|
79
84
|
sock.close
|
80
85
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
client_pid, arguments = $1.to_i, $2
|
88
|
-
arguments.chomp!("\0")
|
89
|
-
rescue => e
|
90
|
-
File.open("b.log","a"){|f|f.puts e.message ; f.puts e.backtrace}
|
91
|
-
end
|
86
|
+
pid_and_arguments = local.recv(1024)
|
87
|
+
pid_and_arguments.chomp!("\0")
|
88
|
+
# pid_and_arguments.force_encoding("ASCII-8BIT")
|
89
|
+
pid_and_arguments =~ /(.*?):(.*)/
|
90
|
+
client_pid, arguments = $1.to_i, $2
|
91
|
+
arguments.chomp!("\0")
|
92
92
|
|
93
93
|
pid = fork {
|
94
94
|
$0 = "zeus command: #{identifier}"
|
@@ -119,9 +119,7 @@ module Zeus
|
|
119
119
|
Thread.new {
|
120
120
|
loop {
|
121
121
|
begin
|
122
|
-
|
123
|
-
x=Process.kill(0, client_pid)
|
124
|
-
File.open("b.log","a"){|f|f.puts "Checked #{client_pid} and got #{x}"}
|
122
|
+
Process.kill(0, client_pid)
|
125
123
|
rescue Errno::ESRCH
|
126
124
|
Process.kill(9, command_pid)
|
127
125
|
end
|
@@ -134,6 +132,7 @@ module Zeus
|
|
134
132
|
features.each do |t|
|
135
133
|
begin
|
136
134
|
sock.write "F:#{t}\0"
|
135
|
+
sock.flush
|
137
136
|
rescue Errno::ENOBUFS
|
138
137
|
sleep 0.2
|
139
138
|
retry
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zeus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.12.0.pre
|
5
|
+
prerelease: 7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Burke Libbey
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: method_source
|
@@ -78,9 +78,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
78
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
79
|
none: false
|
80
80
|
requirements:
|
81
|
-
- - ! '
|
81
|
+
- - ! '>'
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version:
|
83
|
+
version: 1.3.1
|
84
84
|
requirements: []
|
85
85
|
rubyforge_project:
|
86
86
|
rubygems_version: 1.8.23
|