summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael E Brown <mebrown@michaels-house.net>2007-10-19 00:04:49 -0500
committerMichael E Brown <mebrown@michaels-house.net>2007-10-19 00:04:49 -0500
commit49e8b1ed3db4dd6108894a4c79fecec154d62698 (patch)
tree04d3dbaab457aa6353fc07c025fa541fab4ceefd /src
parent63205627de2615ebfe23547b5936168de815c362 (diff)
downloadmock-49e8b1ed3db4dd6108894a4c79fecec154d62698.tar.gz
mock-49e8b1ed3db4dd6108894a4c79fecec154d62698.tar.xz
mock-49e8b1ed3db4dd6108894a4c79fecec154d62698.zip
implement orphanskill feature.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/mock.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mock.py b/src/mock.py
index acd33df..ad988fb 100755
--- a/src/mock.py
+++ b/src/mock.py
@@ -41,6 +41,7 @@ import mock.exception
from mock.trace_decorator import traceLog
import mock.backend
import mock.uid
+import mock.util
# set up basic logging until config file can be read
log = logging.getLogger()
@@ -181,6 +182,7 @@ def main():
set_config_opts_per_cmdline(config_opts, options)
warn_obsolete_config_options(config_opts)
+ killOrphans = 1
try:
# do whatever we're here to do
# uidManager saves current real uid/gid which are unpriviledged (callers)
@@ -247,12 +249,18 @@ def main():
else:
log.error("Unknown command specified: %s" % args[0])
+ except (mock.exception.BuildRootLocked), e:
+ log.error(str(e))
+ killOrphans = 0
+
except (mock.exception.Error), e:
log.error(str(e))
except (Exception,), e:
logging.exception(e)
+ if killOrphans:
+ mock.util.orphansKill(chroot.rootdir)
logging.shutdown()