apache2/find_mpm
Kristyna Streitova 1c66eaf9ed Accepting request 309129 from home:pgajdos
- align filenames with upstream names (and add compat symlinks)
- find_httpd2_includes renamed to find_httpd_includes

OBS-URL: https://build.opensuse.org/request/show/309129
OBS-URL: https://build.opensuse.org/package/show/Apache/apache2?expand=0&rev=447
2015-06-02 08:26:32 +00:00

48 lines
1.2 KiB
Bash

#!/bin/bash
: ${apache_link:=/usr/sbin/httpd}
. /usr/share/apache2/load_configuration
if ! ${mpm_set:=false}; then
if [ -z "$APACHE_MPM" ]; then
# guess
for i in $r/$apache_link-*; do
test -f $i || continue
i=$(basename $i)
i=${i#*-}
installed_mpms=(${installed_mpms[*]} $i)
done
if [ -z "${installed_mpms[*]}" ]; then
echo >&2 ${warn}Apache binary ${apache_link#*-} not found. No MPM package installed? $norm
echo >&2 Hint: install the apache2-prefork package, and try again.
fi
if [ ${#installed_mpms[*]} = 1 ]; then
APACHE_MPM=${installed_mpms[*]}
else
case ${installed_mpms[*]} in
*prefork*) APACHE_MPM=prefork;;
*worker*) APACHE_MPM=worker;;
*event*) APACHE_MPM=event;;
*leader*) APACHE_MPM=leader;;
*metuxmpm*) APACHE_MPM=metuxmpm;;
*threadpool*) APACHE_MPM=threadpool;;
*itk*) APACHE_MPM=itk;;
esac
fi
fi
if [ -x $apache_link-$APACHE_MPM ]; then
ln -sf $apache_link-$APACHE_MPM $apache_link
ln -sf $apache_link-$APACHE_MPM ${apache_link}2
else
echo >&2 ${warn}$apache_link-$APACHE_MPM is not a valid httpd binary.
echo >&2 Check your APACHE_MPM setting.$norm
exit 1
fi
export APACHE_MPM mpm_set=true
fi