diff --git a/branches/ucs-3.2/ucs-3.2-0/base/univention-system-setup/umc/python/setup/util.py b/branches/ucs-3.2/ucs-3.2-0/base/univention-system-setup/umc/python/setup/util.py index 81e54a5..f09e1cc 100644 --- a/branches/ucs-3.2/ucs-3.2-0/base/univention-system-setup/umc/python/setup/util.py +++ b/branches/ucs-3.2/ucs-3.2-0/base/univention-system-setup/umc/python/setup/util.py @@ -353,12 +353,12 @@ def run_scripts( progressParser, restartServer = False ): f.flush() # make sure that UMC servers and apache will not be restartet - subprocess.call( CMD_DISABLE_EXEC, stdout = f, stderr = f ) + subprocess.call(CMD_DISABLE_EXEC, stdout=f, stderr=f, close_fds=True) for scriptpath in sorted_files_in_subdirs( PATH_SETUP_SCRIPTS ): # launch script MODULE.info('Running script %s\n' % scriptpath) - p = subprocess.Popen( scriptpath, stdout = subprocess.PIPE, stderr = subprocess.STDOUT ) + p = subprocess.Popen(scriptpath, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True) while True: line = p.stdout.readline() if not line: @@ -368,13 +368,13 @@ def run_scripts( progressParser, restartServer = False ): p.wait() # enable execution of servers again - subprocess.call(CMD_ENABLE_EXEC, stdout=f, stderr=f) + subprocess.call(CMD_ENABLE_EXEC, stdout=f, stderr=f, close_fds=True) if restartServer: f.write('=== Restart of UMC server and web server (%s) ===\n' % timestamp()) f.flush() - subprocess.call(['/etc/init.d/univention-management-console-server', 'restart'], stdout=f, stderr=f) - subprocess.call(['/etc/init.d/univention-management-console-web-server', 'restart'], stdout=f, stderr=f) + subprocess.call(['/etc/init.d/univention-management-console-server', 'restart'], stdout=f, stderr=f, close_fds=True) + subprocess.call(['/etc/init.d/univention-management-console-web-server', 'restart'], stdout=f, stderr=f, close_fds=True) f.write('\n=== DONE (%s) ===\n\n' % timestamp()) f.close() @@ -388,7 +388,7 @@ def run_joinscript( progressParser, _username, password ): progressParser.fractions[ 'setup-join.sh' ] = 50 progressParser.current.max = sum( progressParser.fractions.values() ) def runit( command ): - p = subprocess.Popen( command, stdout = subprocess.PIPE, stderr = subprocess.STDOUT ) + p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True) while True: line = p.stdout.readline() if not line: @@ -460,11 +460,11 @@ def cleanup(): keys.append(var.replace('/type', '/%s' % k)) univention.config_registry.handler_unset(keys) # Shut down temporary interface - subprocess.call(['ifconfig', var.split('/')[1].replace('_', ':'), 'down']) + subprocess.call(['ifconfig', var.split('/')[1].replace('_', ':'), 'down'], close_fds=True) # force a restart of UMC servers and apache - subprocess.call( CMD_DISABLE_EXEC, stdout = f, stderr = f ) - subprocess.call( CMD_ENABLE_EXEC_WITH_RESTART, stdout = f, stderr = f ) + subprocess.call(CMD_DISABLE_EXEC, stdout=f, stderr=f, close_fds=True) + subprocess.call(CMD_ENABLE_EXEC_WITH_RESTART, stdout=f, stderr=f, close_fds=True) f.write('\n=== DONE (%s) ===\n\n' % timestamp()) f.flush() @@ -529,7 +529,7 @@ def dhclient(interface, timeout=None): '-sf', '/lib/univention-installer/dhclient-script-wrapper', '-e', 'dhclientscript_outputfile=%s' % (tempfilename,), interface) - p = subprocess.Popen(cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE) + p = subprocess.Popen(cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True) # read from stderr until timeout, following recipe of subprocess.communicate() def _readerthread(fh, stringbufferlist): @@ -760,4 +760,3 @@ def get_available_locales(pattern, category='language_en'): }) return locales -