+8
-20
@@ -176,19 +176,14 @@ class Foreman::Engine
|
|||||||
#
|
#
|
||||||
# @param [String] signal The signal to send to each process
|
# @param [String] signal The signal to send to each process
|
||||||
#
|
#
|
||||||
def kill_children(signal="SIGTERM")
|
def kill_children( signal="SIGTERM" )
|
||||||
if Foreman.windows?
|
@running.each do |pid, (process, index)|
|
||||||
@running.each do |pid, (process, index)|
|
system "sending #{signal} to #{name_for(pid)} at pid #{pid}"
|
||||||
system "sending #{signal} to #{name_for(pid)} at pid #{pid}"
|
|
||||||
begin
|
|
||||||
Process.kill(signal, pid)
|
|
||||||
rescue Errno::ESRCH, Errno::EPERM
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
begin
|
||||||
Process.kill signal, *@running.keys unless @running.empty?
|
Process.kill( signal, pid )
|
||||||
rescue Errno::ESRCH, Errno::EPERM
|
rescue Errno::ESRCH, Errno::EPERM => err
|
||||||
|
system " %p when sending signal %p to pid %d: %s" %
|
||||||
|
[ err.class, signal, pid, err.message ]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -198,14 +193,7 @@ class Foreman::Engine
|
|||||||
# @param [String] signal The signal to send
|
# @param [String] signal The signal to send
|
||||||
#
|
#
|
||||||
def killall(signal="SIGTERM")
|
def killall(signal="SIGTERM")
|
||||||
if Foreman.windows?
|
kill_children(signal)
|
||||||
kill_children(signal)
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
Process.kill "-#{signal}", Process.pid
|
|
||||||
rescue Errno::ESRCH, Errno::EPERM
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Get the process formation
|
# Get the process formation
|
||||||
|
|||||||
Reference in New Issue
Block a user