frontkick 0.4.7 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile +2 -0
- data/README.md +2 -1
- data/lib/frontkick/command.rb +6 -18
- data/lib/frontkick/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3514cd020c4022cbe113d670b35b4a2b4112bf68
|
4
|
+
data.tar.gz: 53aa5b300c7c725ad9c00eebf94590c7aa048045
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a91a20a9782fe17a69b09ac0d3e1c09b1a2fa47bc0ce66b1d2498e5ad9fc44faa88e4b6694ad637deacb72d16a0e3cb9159a7bbd46f062c1709ed4e3666a84b
|
7
|
+
data.tar.gz: 630a6f90b0ce7d16f5d07b13e96b89928fe57ea90aecc766727a59279962919e49c1da6847b6d8e893068de43e9576dd98b99588d521b81629cb5f08e327a04e
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -58,9 +58,10 @@ If you prefer to be blocked:
|
|
58
58
|
|
59
59
|
On receiving INT and TERM signal, kill the kicked child process before exiting
|
60
60
|
|
61
|
-
Frontkick.exec("sleep 100", :kill_child => true)
|
61
|
+
Frontkick.exec(["sleep 100"], :kill_child => true)
|
62
62
|
|
63
63
|
NOTE: This uses Kernel.trap inside.
|
64
|
+
NOTE: Shoud use `[]` form, otherwirse `sh -c 'sleep 100'` is ran, and frotkick kills sh process, but sleep process remains
|
64
65
|
|
65
66
|
### Hint: Redirect stderr to stdout
|
66
67
|
|
data/lib/frontkick/command.rb
CHANGED
@@ -27,17 +27,14 @@ module Frontkick
|
|
27
27
|
stdin.close
|
28
28
|
pid = wait_thr.pid
|
29
29
|
|
30
|
-
trapped_signal = nil
|
31
30
|
if opts[:kill_child]
|
32
|
-
trap_signal(pid)
|
31
|
+
trap_signal(pid)
|
33
32
|
end
|
34
33
|
|
35
34
|
stdout = out_reader.value
|
36
35
|
stderr = err_reader.value
|
37
36
|
exit_code = wait_thr.value.exitstatus
|
38
37
|
process_wait(pid)
|
39
|
-
|
40
|
-
exit_signal(trapped_signal) if trapped_signal
|
41
38
|
end
|
42
39
|
end
|
43
40
|
rescue Frontkick::TimeoutLocal => e
|
@@ -60,23 +57,14 @@ module Frontkick
|
|
60
57
|
|
61
58
|
def self.trap_signal(pid)
|
62
59
|
trap :INT do
|
63
|
-
Process.kill(:
|
64
|
-
|
60
|
+
Process.kill(:TERM, pid)
|
61
|
+
process_wait(pid)
|
62
|
+
exit 130
|
65
63
|
end
|
66
64
|
trap :TERM do
|
67
65
|
Process.kill(:TERM, pid)
|
68
|
-
|
69
|
-
|
70
|
-
end
|
71
|
-
|
72
|
-
def self.exit_signal(signal)
|
73
|
-
case signal
|
74
|
-
when :INT
|
75
|
-
exit(130)
|
76
|
-
when :TERM
|
77
|
-
exit(143)
|
78
|
-
else
|
79
|
-
raise 'Non supported signal'
|
66
|
+
process_wait(pid)
|
67
|
+
exit 143
|
80
68
|
end
|
81
69
|
end
|
82
70
|
|
data/lib/frontkick/version.rb
CHANGED