summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2011-09-10 22:58:55 +0000
committerGreg Hudson <ghudson@mit.edu>2011-09-10 22:58:55 +0000
commit1ab76e68154eb7a3ad07b56f284d812134e80a0e (patch)
treec17d0218e975fc7dd24320004bda18c9ed338657
parentc03aede6beac046b6fe02f7be3cce365d7cbdf34 (diff)
downloadkrb5-1ab76e68154eb7a3ad07b56f284d812134e80a0e.tar.gz
krb5-1ab76e68154eb7a3ad07b56f284d812134e80a0e.tar.xz
krb5-1ab76e68154eb7a3ad07b56f284d812134e80a0e.zip
Wait before killing daemons in interactive k5test
If k5test is invoked with any stop, wait, or debug options, wait for input before killing daemons, in case a daemon is being debugged. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25171 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/util/k5test.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/util/k5test.py b/src/util/k5test.py
index ba4f8302bf..f791287830 100644
--- a/src/util/k5test.py
+++ b/src/util/k5test.py
@@ -347,6 +347,7 @@ def password(name):
# prints messages to help developers debug the problem.
def _onexit():
global _daemons, _success, verbose
+ global _debug, _stop_before, _stop_after, _shell_before, _shell_after
if _daemons is None:
# In Python 2.5, if we exit as a side-effect of importing
# k5test, _onexit will execute in an empty global namespace.
@@ -355,6 +356,10 @@ def _onexit():
# daemons have been launched and that we don't really need to
# amend the error message. The bug is fixed in Python 2.6.
return
+ if _debug or _stop_before or _stop_after or _shell_before or _shell_after:
+ # Wait before killing daemons in case one is being debugged.
+ sys.stdout.write('*** Press return to kill daemons and exit script: ')
+ sys.stdin.readline()
for proc in _daemons:
os.kill(proc.pid, signal.SIGTERM)
if not _success: