From c0a7808164341731c6e1a464d9ea5ed9a697b96b Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Tue, 9 Jul 2013 18:52:26 -0700 Subject: [PATCH] rgw: use different daemon name and apache module paths Signed-off-by: Josh Durgin --- teuthology/task/apache.conf.template | 7 ++++--- teuthology/task/rgw.py | 28 +++++++++++++++++++--------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/teuthology/task/apache.conf.template b/teuthology/task/apache.conf.template index 13b6ac9bd190a..397b1d1ad1910 100644 --- a/teuthology/task/apache.conf.template +++ b/teuthology/task/apache.conf.template @@ -1,6 +1,7 @@ -LoadModule env_module /usr/lib/apache2/modules/mod_env.so -LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so -LoadModule fastcgi_module /usr/lib/apache2/modules/mod_fastcgi.so +LoadModule env_module {mod_path}/mod_env.so +LoadModule rewrite_module {mod_path}/mod_rewrite.so +LoadModule fastcgi_module {mod_path}/mod_fastcgi.so +LoadModule log_config_module {mod_path}/mod_log_config.so Listen 7280 ServerName rgwtest.example.com diff --git a/teuthology/task/rgw.py b/teuthology/task/rgw.py index 9a48338b9f062..ddac2915c912e 100644 --- a/teuthology/task/rgw.py +++ b/teuthology/task/rgw.py @@ -50,14 +50,19 @@ def ship_config(ctx, config): assert isinstance(config, dict) testdir = teuthology.get_testdir(ctx) log.info('Shipping apache config and rgw.fcgi...') - src = os.path.join(os.path.dirname(__file__) - , 'apache.conf.template').format( - testdir=testdir - ) + src = os.path.join(os.path.dirname(__file__), 'apache.conf.template') for client in config.iterkeys(): (remote,) = ctx.cluster.only(client).remotes.keys() + system_type = teuthology.get_system_type(remote) + if system_type == 'deb': + mod_path = '/usr/lib/apache2/modules' + else: + mod_path = '/usr/lib64/httpd/modules' with file(src, 'rb') as f: - conf = f.read().format(testdir=testdir) + conf = f.read().format( + testdir=testdir, + mod_path=mod_path, + ) teuthology.write_file( remote=remote, path='{tdir}/apache/apache.conf'.format(tdir=testdir), @@ -170,14 +175,19 @@ def start_apache(ctx, config): apaches = {} for client in config.iterkeys(): (remote,) = ctx.cluster.only(client).remotes.keys() + system_type = teuthology.get_system_type(remote) + if system_type == 'deb': + apache_name = 'apache2' + else: + apache_name = '/usr/sbin/httpd' proc = remote.run( args=[ '{tdir}/adjust-ulimits'.format(tdir=testdir), '{tdir}/daemon-helper'.format(tdir=testdir), - 'kill'.format(tdir=testdir), - 'apache2'.format(tdir=testdir), - '-X'.format(tdir=testdir), - '-f'.format(tdir=testdir), + 'kill', + apache_name, + '-X', + '-f', '{tdir}/apache/apache.conf'.format(tdir=testdir), ], logger=log.getChild(client), -- 2.39.5