Hi Stephen,
On Sun, Oct 25, 2009 at 08:28:47PM -0400, Stephen Byrne wrote:
> Dejan,
>
> I found your name and email address with a replacement for
> /usr/lib/ocf/resource.d/heartbeat/apache for Linux HA on Debian
> Lenny.
>
> I had to make the following change to get it to work,
In which way it didn't work? BTW, the script in Debian Lenny seems
to be outdated judging by your patch.
> and thought I
> would share it with you. OCF expects 7 if it is not running, and
> previously it returned 1.
In this case if the apache process is running (that would be
checked before testing status), it seems more logical to me to
return generic error if grep doesn't find what it expects, i.e. it
is most probable that wget (or curl) failed.
Cheers,
Dejan
> --- apache.dejan 2009-10-25 17:42:58.000000000 -0400
> +++ apache 2009-10-25 20:09:31.000000000 -0400
> @@ -171,7 +171,12 @@
>
> monitor_apache() {
> # TODO: Implement monitoring when there is no status url.
> - sh -c "\"$APACHE2CTL\" status | tr '\012' ' ' | grep -Ei
> \"$TESTREGEX\" >/dev/null"
> + sh -c "\"$APACHE2CTL\" status | tr '\012' ' ' | grep -Ei
> \"$TESTREGEX\" >/dev/null 2>/dev/null"
> + if [ "$?" == "0" ]; then
> + return 0
> + else
> + return 7
> + fi
> }
>
> validate_all_apache() {
>
> Regards,
>
> --
> Stephen Byrne
> [email protected]
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems