daemonite 0.5.6 → 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/daemonite.gemspec +1 -1
- data/lib/daemonite.rb +9 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62d8dd46ec738b5e6b246c86ceead1b03682b1579dd40a44048dbb316694bc5f
|
4
|
+
data.tar.gz: 3f25d52e80286edc9f6957b437edb53dcbe74deba57482237700358a2d801305
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20c8c017f7f846fad18be36e40a2b5f32f2b285ed5fad2e83aa675756bcb0f0c55935e1ef04b15cda50b1283037e46d6903bc12519d21cbfbf0f1111c60b7ec3
|
7
|
+
data.tar.gz: 78a442b97feaa7d013fb4c46f8ded4264cffb199f0c5b9a55ad5470936e52a16bf8870678cf9d5361060b169ddb03cfea1ea8830b8541c351d578097c12b271a
|
data/daemonite.gemspec
CHANGED
data/lib/daemonite.rb
CHANGED
@@ -33,7 +33,8 @@ module Daemonism
|
|
33
33
|
:runtime_proc => nil,
|
34
34
|
:cmdl_info => nil,
|
35
35
|
:cmdl_parsing => true,
|
36
|
-
:cmdl_operation => 'start'
|
36
|
+
:cmdl_operation => 'start',
|
37
|
+
:kill_amount => 1000
|
37
38
|
}
|
38
39
|
|
39
40
|
def daemonism(opts={},&block)
|
@@ -128,8 +129,14 @@ module Daemonism
|
|
128
129
|
else
|
129
130
|
puts "Server #{opts[:cmdl_info].nil? ? '' : '(' + opts[:cmdl_info].to_s + ') '}stopped"
|
130
131
|
puts "Waiting while server goes down ..."
|
132
|
+
count = 0
|
131
133
|
while status.call
|
132
|
-
|
134
|
+
if count > opts[:kill_amount]
|
135
|
+
Process.kill "SIGKILL", pid
|
136
|
+
else
|
137
|
+
Process.kill "SIGTERM", pid
|
138
|
+
end
|
139
|
+
count += 1
|
133
140
|
sleep 0.3
|
134
141
|
end
|
135
142
|
end
|