[molecule.utils] remove RUNNING_PIDS set

This ill conceived idea of killing stale chroot child processes does more
harm than good and the idea has been inherited long time ago from the Catalyst
codebase. Chroot processes are responsible of their cleanup.
This commit is contained in:
Fabio Erculiani
2012-09-09 18:23:30 +02:00
parent 910de14935
commit 2853bcc330
2 changed files with 0 additions and 11 deletions
-7
View File
@@ -25,11 +25,6 @@ sys.path.insert(0,'molecule/')
sys.path.insert(0,'.')
import molecule.cmdline
from molecule.handlers import Runner
from molecule.utils import RUNNING_PIDS
def kill_pids():
for pid in RUNNING_PIDS:
os.kill(pid, signal.SIGTERM)
parse_data = molecule.cmdline.parse()
if parse_data is None:
@@ -46,12 +41,10 @@ for el in molecule_data_order:
except KeyboardInterrupt:
while True:
my.kill()
kill_pids()
break
raise SystemExit(1)
while True:
my.kill()
kill_pids()
break
if rc != 0:
raise SystemExit(rc)
-4
View File
@@ -31,8 +31,6 @@ random.seed()
from molecule.compat import convert_to_rawstring
RUNNING_PIDS = set()
def get_year():
"""
@@ -153,9 +151,7 @@ def exec_chroot_cmd(args, chroot, pre_chroot = None, env = None):
myargs = pre_chroot+args
os.execvp(myargs[0], myargs)
else:
RUNNING_PIDS.add(pid)
rcpid, rc = os.waitpid(pid, 0)
RUNNING_PIDS.discard(pid)
return rc
def kill_chroot_pids(chroot, sig = signal.SIGTERM, sleep = False):