Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf269c39da | ||
|
|
76cd2e794b |
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
foreman (0.32.0)
|
foreman (0.33.0)
|
||||||
term-ansicolor (~> 1.0.5)
|
term-ansicolor (~> 1.0.5)
|
||||||
thor (>= 0.13.6)
|
thor (>= 0.13.6)
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,2 +1,2 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/bin/sh
|
||||||
exec "#{ARGV.join(' ')} 2>&1"
|
exec $1 2>&1
|
||||||
|
|||||||
@@ -72,16 +72,10 @@ private ######################################################################
|
|||||||
def kill_all(signal="SIGTERM")
|
def kill_all(signal="SIGTERM")
|
||||||
running_processes.each do |pid, process|
|
running_processes.each do |pid, process|
|
||||||
info "sending #{signal} to pid #{pid}"
|
info "sending #{signal} to pid #{pid}"
|
||||||
kill(signal, -pid) or kill(signal, pid)
|
Process.kill(signal, pid) rescue Errno::ESRCH
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def kill(signal, pid)
|
|
||||||
Process.kill signal, pid
|
|
||||||
rescue Errno::ESRCH
|
|
||||||
false
|
|
||||||
end
|
|
||||||
|
|
||||||
def terminate_gracefully
|
def terminate_gracefully
|
||||||
info "sending SIGTERM to all processes"
|
info "sending SIGTERM to all processes"
|
||||||
kill_all "SIGTERM"
|
kill_all "SIGTERM"
|
||||||
|
|||||||
@@ -30,13 +30,11 @@ private
|
|||||||
def fork_with_io(command)
|
def fork_with_io(command)
|
||||||
reader, writer = IO.pipe
|
reader, writer = IO.pipe
|
||||||
pid = fork do
|
pid = fork do
|
||||||
Process.setpgrp
|
|
||||||
trap("INT", "IGNORE")
|
trap("INT", "IGNORE")
|
||||||
$stdout.reopen writer
|
$stdout.reopen writer
|
||||||
reader.close
|
reader.close
|
||||||
exec Foreman.runner, replace_command_env(command)
|
exec Foreman.runner, replace_command_env(command)
|
||||||
end
|
end
|
||||||
Process.detach pid
|
|
||||||
[ reader, pid ]
|
[ reader, pid ]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
module Foreman
|
module Foreman
|
||||||
|
|
||||||
VERSION = "0.32.0"
|
VERSION = "0.33.0"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user