From ceca0b5591c5a7c9de329eec19968b2d324d4247 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Mon, 7 Apr 2014 12:40:52 +0200 Subject: ipatests: Fix apache semaphores prior to installing IPA server Reviewed-By: Petr Viktorin --- ipatests/test_integration/tasks.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ipatests/test_integration') diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py index d03ee6021..7f738e3d0 100644 --- a/ipatests/test_integration/tasks.py +++ b/ipatests/test_integration/tasks.py @@ -111,6 +111,18 @@ def fix_resolv_conf(host): host.put_file_contents('/etc/resolv.conf', contents) +def fix_apache_semaphores(master): + systemd_available = master.transport.file_exists('/bin/systemctl') + + if systemd_available: + master.run_command(['systemctl', 'stop', 'httpd'], raiseonerr=False) + else: + master.run_command(['/sbin/service', 'httpd', 'stop'], raiseonerr=False) + + master.run_command('for line in `ipcs -s | grep apache | cut -d " " -f 2`; ' + 'do ipcrm -s $line; done', raiseonerr=False) + + def unapply_fixes(host): restore_files(host) restore_hostname(host) @@ -179,6 +191,7 @@ def install_master(host): host.collect_log('/var/log/dirsrv/slapd-%s/access' % inst) apply_common_fixes(host) + fix_apache_semaphores(host) host.run_command(['ipa-server-install', '-U', '-r', host.domain.name, @@ -197,6 +210,7 @@ def install_replica(master, replica, setup_ca=True): replica.collect_log('/var/log/ipareplica-conncheck.log') apply_common_fixes(replica) + fix_apache_semaphores(replica) master.run_command(['ipa-replica-prepare', '-p', replica.config.dirman_password, -- cgit