From 712f719f63922f79fc2bc8c677bdc4c58ce6c46b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Wed, 11 Apr 2012 15:23:42 +0000 Subject: [PATCH] Dirty hacks to support Debian. --- .../gridsite/tests/gridsite-common-testbeds.sh | 34 +++++++++++++++++++--- .../gridsite/tests/gridsite-test-all.sh | 12 ++++++-- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/org.glite.testsuites.ctb/gridsite/tests/gridsite-common-testbeds.sh b/org.glite.testsuites.ctb/gridsite/tests/gridsite-common-testbeds.sh index 0a68cf9..1eb7258 100755 --- a/org.glite.testsuites.ctb/gridsite/tests/gridsite-common-testbeds.sh +++ b/org.glite.testsuites.ctb/gridsite/tests/gridsite-common-testbeds.sh @@ -24,10 +24,12 @@ COPYPROXY=$2 egrep -i "Debian|Ubuntu" /etc/issue if [ $? = 0 ]; then INSTALLCMD="apt-get install -q --yes" - INSTALLPKGS="lintian apache2 netcat-traditional" + INSTALLPKGS="lintian apache2 netcat-traditional psmisc" + HTTPD_SERVER_ROOT=/etc/apache2 else INSTALLCMD="yum install -q -y --nogpgcheck" INSTALLPKGS="rpmlint httpd nc mod_ssl" + HTTPD_SERVER_ROOT=/etc/httpd fi cat << EndArrangeScript > arrange_gridsite_test_root.sh @@ -45,6 +47,12 @@ export GSTSTCOLS ${INSTALLCMD} voms-clients curl wget lsof $INSTALLPKGS +if [ -d /etc/apache2 -a ! -d /etc/apache2/modules ]; then + ln -s ../../var/log/apache2 /etc/apache2/logs + ln -s ../../usr/lib/apache2/modules /etc/apache2/modules + ln -s ../../var/run/apache2 /etc/apache2/run +fi + HTTPD_CONFDIR=/tmp for dir in /etc/httpd /etc/apache /etc/apache2; do if [ -d \$dir ]; then @@ -54,6 +62,12 @@ for dir in /etc/httpd /etc/apache /etc/apache2; do done HTTPD_CONF=\$HTTPD_CONFDIR/gridsite-webserver.conf +if getent passwd www-data >/dev/null; then + HTTPD_USER=www-data +else + HTTPD_USER=apache +fi + # Debian compress everything inside /usr/share/doc HTTPD_CONF_SRC=\`ls -1 /usr/share/doc/gridsite-*/httpd-webserver.conf* | head -n 1\` if echo \$HTTPD_CONF_SRC | grep '\.gz$' >/dev/null 2>&1; then @@ -65,15 +79,27 @@ if [ -z "\$HTTPD_CONF_SRC" ]; then exit 2 fi -sed -e '1,\$s!/usr/lib/httpd/modules/!modules/!' \$HTTPD_CONF_SRC | sed 's!/var/www/html!/var/www/htdocs!' | sed "s/FULL.SERVER.NAME/\$(hostname -f)/" | sed "s/\(GridSiteGSIProxyLimit\)/# \1/"> \$HTTPD_CONF +sed \\ + -e '1,\$s!/usr/lib/httpd/modules/!modules/!' \\ + -e 's!/var/www/html!/var/www/htdocs!' \\ + -e "s/FULL.SERVER.NAME/\$(hostname -f)/" \\ + -e "s/\(GridSiteGSIProxyLimit\)/# \1/" \\ + -e "s!^\(ServerRoot\).*!\1 $HTTPD_SERVER_ROOT!" \\ + -e "s/^User .*/User \$HTTPD_USER/" \\ + -e "s/^Group .*/Group \$HTTPD_USER/" \\ + \$HTTPD_CONF_SRC > \$HTTPD_CONF echo "AddHandler cgi-script .cgi" >> \$HTTPD_CONF echo "ScriptAlias /gridsite-delegation.cgi /usr/sbin/gridsite-delegation.cgi" >> \$HTTPD_CONF +# internal module? +if [ ! -f \$HTTPD_SERVER_ROOT/modules/mod_log_config.so ]; then + sed -i 's/^\(LoadModule\\s\\+log_config_module.*\)/# \1/' \$HTTPD_CONF +fi mkdir -p /var/www/htdocs killall httpd apache2 >/dev/null 2>&1 sleep 2 killall -9 httpd apache2 >/dev/null 2>&1 -echo Starting httpd -f \$HTTPD_CONF -httpd -f \$HTTPD_CONF +echo Starting \$SYS_APACHE -f \$HTTPD_CONF +\$SYS_APACHE -f \$HTTPD_CONF cd /tmp diff --git a/org.glite.testsuites.ctb/gridsite/tests/gridsite-test-all.sh b/org.glite.testsuites.ctb/gridsite/tests/gridsite-test-all.sh index 0ccf266..f66bfe9 100755 --- a/org.glite.testsuites.ctb/gridsite/tests/gridsite-test-all.sh +++ b/org.glite.testsuites.ctb/gridsite/tests/gridsite-test-all.sh @@ -91,6 +91,12 @@ else test_done fi +if getent passwd www-data >/dev/null; then + HTTPD_USER=www-data +else + HTTPD_USER=apache +fi + if [ ! -e /var/www/htdocs ]; then mkdir /var/www/htdocs @@ -172,7 +178,7 @@ https://$(hostname -f)/` rm -f /var/www/htdocs/.gacl /var/www/htdocs/test.txt date > /tmp/test.txt - chown apache /var/www/htdocs/ + chown $HTTPD_USER /var/www/htdocs/ printf "Plain write... " code=`curl --cert /etc/grid-security/hostcert.pem --key /etc/grid-security/hostkey.pem --capath /etc/grid-security/certificates --output /dev/null --silent --write-out '%{http_code}\n' --upload-file /tmp/test.txt https://$(hostname -f)/test.txt` @@ -279,7 +285,7 @@ cat >/var/www/htdocs/.gacl < EOF - chown apache /var/www/htdocs/ + chown $HTTPD_USER /var/www/htdocs/ date > /tmp/test.txt @@ -347,7 +353,7 @@ EOF if [ ! -e /var/www/proxycache ]; then mkdir /var/www/proxycache fi - chown apache /var/www/proxycache + chown $HTTPD_USER /var/www/proxycache #delegation id=`htproxyput --cert /tmp/x509up_u0 --key /tmp/x509up_u0 --capath /etc/grid-security/certificates https://$(hostname -f)/gridsite-delegation.cgi` -- 1.8.2.3