[Linux-ha-dev] Apache resource agent broken in Debian lenny

Florian Knauf f.knauf at mmkf.de
Sat Jul 19 13:41:29 MDT 2008


Hi,

If I should have written this to the Debian package maintainer, my bad,
but since there's a debian/ subdirectory in the source tree, I thought
this might interest you.

The latest apache2.2-common update in Debian lenny (2.2.9-5) breaks the
hearbeat ocf resource agent heuristics that determine what user to run
it as and where to put the pid file. The apache2.conf now sports

PidFile ${APACHE_PID_FILE}
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

instead of the actual place and user/group ids, which are specified in
/etc/apache2/envvars like so:

export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
export APACHE_PID_FILE=/var/run/apache2.pid

Since the resource agent basically greps the apache configuration for
these, it ends up using ${APACHE_FOO_BAR}, and since
/etc/apache2/envvars is never read, leaves them empty - which makes the
whole thing fail miserably.

In principle, the fix for this is trivial - the resource agent just has
to do something like

if [ -e /etc/apache2/envvars ]; then
    . /etc/apache2/envvars
fi

before the action starts - this is what /etc/init.d/apache2 does.
However, I am unsure whether hardcoding it in this manner is the right
way to go - it might be prudent to make it a runtime variable like
OCF_RESKEY_configfile, only to be loaded if specified.

What do you think?

Regards,

Florian Knauf


More information about the Linux-HA-Dev mailing list