}
# kill server and wait for the process to be totally exited
+ catch {exec kill $pid}
while {[is_alive $config]} {
- if {[incr wait 10] % 1000 == 0} {
+ incr wait 10
+
+ if {$wait >= 5000} {
+ puts "Forcing process $pid to exit..."
+ catch {exec kill -KILL $pid}
+ } elseif {$wait % 1000 == 0} {
puts "Waiting for process $pid to exit..."
}
- catch {exec kill $pid}
after 10
}
while 1 {
# check that the server actually started and is ready for connections
- if {[exec cat $stdout | grep "ready to accept" | wc -l] > 0} {
+ if {[exec grep "ready to accept" | wc -l < $stdout] > 0} {
break
}
after 10