[Linux-ha-dev] Apache resource agent broken in Debian lenny
Dejan Muhamedagic
dejanmm at fastmail.fm
Sun Jul 20 09:30:20 MDT 2008
Hi,
On Sat, Jul 19, 2008 at 09:41:29PM +0200, Florian Knauf wrote:
> 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.
This is the right place to discuss all heartbeat development
related issues.
> 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
The fix is not that trivial: the apache would understand, but the
RA wouldn't, because it parses the apache configuration without
expanding variables.
> 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?
Thanks for bringing this up.
I'm not sure if we should deal with this at all in heartbeat.
Trying to support all the new setups and distributions, it may
become a nightmare. For the maintenance too: dealing with the
apache configuration is already rather complex and I'm really
reluctant to make it more so. However, since apache now supports
variables in the config and that may become a norm in future,
perhaps we should support environment variables too. Sigh.
Another option may be to kindly ask the apache people to provide
some facility to query the server configuration.
In the meantime, just don't use environment variables in the
configuration.
Can you please file an enhancement bugzilla.
Cheers,
Dejan
> Regards,
>
> Florian Knauf
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev at lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
More information about the Linux-HA-Dev
mailing list