7066541 installing several zones in parallel sometimes fail: [Errno 17] File exists: '/var/tmp/install'
--- a/usr/src/cmd/auto-install/auto-install.py Fri Aug 19 13:30:15 2011 -0700
+++ b/usr/src/cmd/auto-install/auto-install.py Fri Aug 19 16:27:56 2011 -0700
@@ -37,6 +37,6 @@
print "ERROR: an exception occurred.\n"
print "\n".join(["%s%s" % (" ", l) for l in str(e).splitlines()])
print "\nPlease check logs for futher information."
- sys.exit(ai.AI_EXIT_FAILURE)
+ sys.exit(auto_install.AutoInstall.AI_EXIT_FAILURE)
except KeyboardInterrupt:
pass
--- a/usr/src/lib/install_logging_pymod/logger.py Fri Aug 19 13:30:15 2011 -0700
+++ b/usr/src/lib/install_logging_pymod/logger.py Fri Aug 19 16:27:56 2011 -0700
@@ -22,6 +22,7 @@
# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
#
''' Code specific for the implementation of the InstallLogger'''
+import errno
import logging
import logging.handlers
import os
@@ -252,7 +253,12 @@
# Make sure DEFAULTLOG is usable by everyone, even if created by root.
logdir = os.path.dirname(DEFAULTLOG)
if not os.path.exists(logdir):
- os.mkdir(logdir)
+ try:
+ os.mkdir(logdir)
+ except OSError as err:
+ if err.errno != errno.EEXIST:
+ raise
+
statbuf = os.stat(logdir)
if (statbuf.st_mode & 01777) != 01777:
os.chmod(logdir, 01777)