I'm running Debian Lenny.

I can't get apache RA to behave. I downloaded the latest one with
envvars support, but that didn't help. The RA actually starts apache,
but for some reason it doesn't understand that its running. Wget works
fine on the status page. Any thoughts?

I have included the output of wget, ps, and ocf-tester below. I added -x
to the apache RA start line in ocf-tester to get the debug output.

-BB

db1:/tmp$ wget -O- -q -L http://localhost/server-status
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html><head>
<title>Apache Status</title>
</head><body>
<h1>Apache Server Status for localhost</h1>

<dl><dt>Server Version: Apache/2.2.9 (Debian) PHP/5.2.6-5 with
Suhosin-Patch</dt>
<dt>Server Built: Oct  1 2008 14:37:52
</dt></dl><hr /><dl>
<dt>Current Time: Thursday, 23-Oct-2008 14:17:42 PDT</dt>
<dt>Restart Time: Thursday, 23-Oct-2008 14:14:14 PDT</dt>
<dt>Parent Server Generation: 0</dt>
<dt>Server uptime:  3 minutes 28 seconds</dt>
<dt>1 requests currently being processed, 4 idle workers</dt>
</dl><pre>W____.........................................................
..
................................................................
................................................................
................................................................
</pre>
<p>Scoreboard Key:<br />
"<b><code>_</code></b>" Waiting for Connection, 
"<b><code>S</code></b>" Starting up, 
"<b><code>R</code></b>" Reading Request,<br />
"<b><code>W</code></b>" Sending Reply, 
"<b><code>K</code></b>" Keepalive (read), 
"<b><code>D</code></b>" DNS Lookup,<br />
"<b><code>C</code></b>" Closing connection, 
"<b><code>L</code></b>" Logging, 
"<b><code>G</code></b>" Gracefully finishing,<br /> 
"<b><code>I</code></b>" Idle cleanup of worker, 
"<b><code>.</code></b>" Open slot with no current process</p>
<p />
PID Key: <br />
<pre>
   6514 in state: W ,   6515 in state: _ ,   6517 in state: _ 
   6519 in state: _ ,   6520 in state: _ ,
</pre>
<hr />To obtain a full report with current status information you need
to use the <code>ExtendedStatus On</code> directive.
<hr />
<address>Apache/2.2.9 (Debian) PHP/5.2.6-5 with Suhosin-Patch Server at
localhost Port 80</address>
</body></html>
db1:/tmp$



db1:/var/tmp/xml# ocf-tester -v -n apache -o
configfile=/etc/apache2/apache2.conf -o httpd=/usr/sbin/apache2ctl -o
statusurl=http://localhost/server-status -o
envfiles=/etc/apache2/envvars /usr/lib/ocf/resource.d/heartbeat/apache
Beginning tests for /usr/lib/ocf/resource.d/heartbeat/apache...
Testing permissions with uid nobody
Testing: meta-data
Testing: meta-data
+ . /usr/lib/ocf/resource.d/heartbeat/.ocf-shellfuncs
++ unset LC_ALL
++ export LC_ALL
++ unset LANGUAGE
++ export LANGUAGE
+++ basename /usr/lib/ocf/resource.d/heartbeat/apache
++ __SCRIPT_NAME=apache
++ . /etc/ha.d/shellfuncs
+++ prefix=/usr
+++ exec_prefix=/usr
+++ : /etc/ha.d
+++ : /etc/ha.d/rc.d
+++ : /etc/ha.d/conf
+++ : /etc/ha.d/ha.cf
+++ : /var/lib/heartbeat
+++ : /var/run/heartbeat/rsctmp
+++ : /var/lib/heartbeat/fifo
+++ : /usr/lib/heartbeat
+++ : /usr/share/heartbeat
+++ : '%Y/%m/%d_%T '
+++ : /dev/null
+++ : /etc/ha.d/resource.d
+++ : /usr/share/doc/heartbeat
+++ : apache
+++ : 'apache[6341]'
+++ : /var/run/
+++ : /var/lock/subsys/
+++ : /usr/sbin
+++ export HA_DIR HA_RCDIR HA_FIFO HA_BIN
+++ export HA_DEBUGLOG HA_LOGFILE HA_LOGFACILITY
+++ export HA_DATEFMT HA_RESOURCEDIR HA_DOCDIR
+++ TESTPROG=/usr/bin/test
+++
PATH=/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++++ echo
/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/usr/l
ocal/bin:/usr/sbin:/usr/bin:/sbin:/bin
++++ sed -e s%::%% -e 's%:\.:%:%' -e 's%^:%%' -e 's%^\.:%%'
+++
PATH=/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+++ export PATH
++ '[' -z /usr/lib/ocf ']'
++ . /usr/lib/ocf/resource.d/heartbeat/.ocf-binaries
+++
PATH=/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/bin:/usr/sbin:/usr/bi
n
+++
PATH=/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/bin:/usr/sbin:/usr/bi
n:/usr/ucb
+++ export PATH
+++ : /usr/bin/mawk
+++ : '/bin/grep -E'
+++ : -a
+++ : mailx
+++ : /bin/ping
+++ :
+++ : /bin/sh
+++ : /usr/bin/test
+++ : /usr/bin/test
+++ : basename
+++ : blockdev
+++ : cat
+++ : fsck
+++ : fuser
+++ : getent
+++ : grep
+++ : ifconfig
+++ : iptables
+++ : ip
+++ : mdadm
+++ : modprobe
+++ : mount
+++ : msgfmt
+++ : netstat
+++ : perl
+++ : python
+++ : raidstart
+++ : raidstop
+++ : route
+++ : umount
+++ : reboot
+++ : poweroff
+++ : wget
+++ : whoami
+++ : strings
+++ : scp
+++ : ssh
+++ : swig
+++ : gzip
+++ : tar
+++ : md5
+++ : drbdadm
+++ : drbdsetup
++ . /usr/lib/ocf/resource.d/heartbeat/.ocf-returncodes
+++ OCF_SUCCESS=0
+++ OCF_ERR_GENERIC=1
+++ OCF_ERR_ARGS=2
+++ OCF_ERR_UNIMPLEMENTED=3
+++ OCF_ERR_PERM=4
+++ OCF_ERR_INSTALLED=5
+++ OCF_ERR_CONFIGURED=6
+++ OCF_NOT_RUNNING=7
+++ OCF_RUNNING_MASTER=8
+++ OCF_FAILED_MASTER=9
++ . /usr/lib/ocf/resource.d/heartbeat/.ocf-directories
+++ prefix=/usr
+++ exec_prefix=/usr
+++ : /etc/init.d
+++ : /etc/ha.d
+++ : /etc/ha.d/rc.d
+++ : /etc/ha.d/conf
+++ : /etc/ha.d/ha.cf
+++ : /var/lib/heartbeat
+++ : /var/run/heartbeat/rsctmp
+++ : /var/lib/heartbeat/fifo
+++ : /usr/lib/heartbeat
+++ : /usr/sbin
+++ : %Y/%m/%d_%T
+++ : /dev/null
+++ : /etc/ha.d/resource.d
+++ : /usr/share/doc/heartbeat
+++ : apache
+++ : 'apache[6341]'
+++ : /var/run/
+++ : /var/lock/subsys/
++ __ocf_set_defaults meta-data
++ __OCF_ACTION=meta-data
++ unset LANG
++ LC_ALL=C
++ export LC_ALL
++ '[' -z '' ']'
++ : 0
++ '[' '!' -d /usr/lib/ocf ']'
++ '[' -z '' ']'
++ : apache
++ '[' -z '' ']'
++ : We are being invoked as an init script.
++ : Fill in some things with reasonable values.
++ : default
++ return 0
+ HA_VARRUNDIR=/var/run/
+ IBMHTTPD=/opt/IBMHTTPServer/bin/httpd
+ HTTPDLIST='/sbin/httpd2 /usr/sbin/httpd2 /usr/sbin/apache2 /sbin/httpd
/usr/sbin/httpd /usr/sbin/apache /opt/IBMHTTPServer/bin/httpd'
+ MPM=/usr/share/apache2/find_mpm
+ '[' -x /usr/share/apache2/find_mpm ']'
+ WGETOPTS='-O- -q -L'
+ LOCALHOST=http://localhost
+ HTTPDOPTS=-DSTATUS
+ DEFAULT_IBMCONFIG=/opt/IBMHTTPServer/conf/httpd.conf
+ DEFAULT_NORMCONFIG=/etc/apache2/httpd.conf
++ basename /usr/lib/ocf/resource.d/heartbeat/apache
+ CMD=apache
+ '[' 1 -eq 1 ']'
+ COMMAND=meta-data
+ HTTPD=
+ PORT=
+ STATUSURL=
+ CONFIGFILE=
+ OPTIONS=
+ TESTREGEX='</ *body *>[[:space:]]*</ *html *>'
+ source_envfiles
+ LSB_STATUS_STOPPED=3
+ '[' X = X -o '!' -f '' -o '!' -x '' ']'
+ case $0 in
+ HTTPD=
+ for h in '$HTTPDLIST'
+ '[' -f /sbin/httpd2 -a -x /sbin/httpd2 ']'
+ for h in '$HTTPDLIST'
+ '[' -f /usr/sbin/httpd2 -a -x /usr/sbin/httpd2 ']'
+ for h in '$HTTPDLIST'
+ '[' -f /usr/sbin/apache2 -a -x /usr/sbin/apache2 ']'
+ HTTPD=/usr/sbin/apache2
+ break
+ '[' -z /usr/sbin/apache2 ']'
+ '[' X '!=' X ']'
+ DefaultConfig=/etc/apache2/httpd.conf
++ basename /usr/sbin/apache2
+ httpd_basename=apache2
+ case $httpd_basename in
+ case "$CONFIGFILE" in
+ CONFIGFILE=/etc/apache2/httpd.conf
+ '[' '!' -f /etc/apache2/httpd.conf ']'
+ '[' Xmeta-data = Xmeta-data ']'
+ : OK
+ case $COMMAND in
+ metadata_apache
+ cat
<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="apache">
<version>1.0</version>

<longdesc lang="en">
This is the resource agent for the
Apache web server.
Thie resource agent operates both version 1.x and version 2.x Apache
servers.
See also http://httpd.apache.org/
</longdesc>
<shortdesc lang="en">Apache web server</shortdesc>

<parameters>
<parameter name="configfile" required="1" unique="1">
<longdesc lang="en">
The full pathname of the Apache configuration file.
This file is parsed to provide defaults for various other
resource agent parameters.
</longdesc>
<shortdesc lang="en">configuration file path</shortdesc>
<content type="string" default="/etc/apache2/httpd.conf" />
</parameter>

<parameter name="httpd">
<longdesc lang="en">
The full pathname of the httpd binary (optional).
</longdesc>
<shortdesc lang="en">httpd binary path</shortdesc>
<content type="string" default="/usr/sbin/httpd" />
</parameter>

<parameter name="port" >
<longdesc lang="en">
A port number that we can probe for status information
using the statusurl.
This will default to the port number found in the
configuration file, or 80, if none can be found
in the configuration file.

</longdesc>
<shortdesc lang="en">httpd port</shortdesc>
<content type="integer" />
</parameter>

<parameter name="statusurl">
<longdesc lang="en">
The URL of the apache status module.
If left unspecified, it will be inferred
from the apache configuration file.
</longdesc>
<shortdesc lang="en">url name</shortdesc>
<content type="string" />
</parameter>

<parameter name="options">
<longdesc lang="en">
Extra options to apply when starting apache. See man httpd(8).
</longdesc>
<shortdesc lang="en">command line options</shortdesc>
<content type="string" />
</parameter>

<parameter name="testregex">
<longdesc lang="en">
Regular expression to match in the output of statusurl. It
is case insensitive.
</longdesc>
<shortdesc lang="en">test regular expression</shortdesc>
<content type="string" />
</parameter>

<parameter name="envfiles">
<longdesc lang="en">
File(s) which contain extra environment variables, such as
/etc/apache2/envvars.
</longdesc>
<shortdesc lang="en">environment settings files</shortdesc>
<content type="string" />
</parameter>

</parameters>

<actions>
<action name="start"   timeout="90" />
<action name="stop"    timeout="100" />
<action name="status"  timeout="30" />
<action name="monitor" depth="0"  timeout="20" interval="10"
start-delay="1m" />
<action name="meta-data"  timeout="5" />
<action name="validate-all"  timeout="5" />
</actions>
</resource-agent>
+ exit 0
Testing: validate-all
+ . /usr/lib/ocf/resource.d/heartbeat/.ocf-shellfuncs
++ unset LC_ALL
++ export LC_ALL
++ unset LANGUAGE
++ export LANGUAGE
+++ basename /usr/lib/ocf/resource.d/heartbeat/apache
++ __SCRIPT_NAME=apache
++ . /etc/ha.d/shellfuncs
+++ prefix=/usr
+++ exec_prefix=/usr
+++ : /etc/ha.d
+++ : /etc/ha.d/rc.d
+++ : /etc/ha.d/conf
+++ : /etc/ha.d/ha.cf
+++ : /var/lib/heartbeat
+++ : /var/run/heartbeat/rsctmp
+++ : /var/lib/heartbeat/fifo
+++ : /usr/lib/heartbeat
+++ : /usr/share/heartbeat
+++ : '%Y/%m/%d_%T '
+++ : /dev/null
+++ : /etc/ha.d/resource.d
+++ : /usr/share/doc/heartbeat
+++ : apache
+++ : 'apache[6350]'
+++ : /var/run/
+++ : /var/lock/subsys/
+++ : /usr/sbin
+++ export HA_DIR HA_RCDIR HA_FIFO HA_BIN
+++ export HA_DEBUGLOG HA_LOGFILE HA_LOGFACILITY
+++ export HA_DATEFMT HA_RESOURCEDIR HA_DOCDIR
+++ TESTPROG=/usr/bin/test
+++
PATH=/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++++ echo
/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/usr/l
ocal/bin:/usr/sbin:/usr/bin:/sbin:/bin
++++ sed -e s%::%% -e 's%:\.:%:%' -e 's%^:%%' -e 's%^\.:%%'
+++
PATH=/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+++ export PATH
++ '[' -z /usr/lib/ocf ']'
++ . /usr/lib/ocf/resource.d/heartbeat/.ocf-binaries
+++
PATH=/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/bin:/usr/sbin:/usr/bi
n
+++
PATH=/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/bin:/usr/sbin:/usr/bi
n:/usr/ucb
+++ export PATH
+++ : /usr/bin/mawk
+++ : '/bin/grep -E'
+++ : -a
+++ : mailx
+++ : /bin/ping
+++ :
+++ : /bin/sh
+++ : /usr/bin/test
+++ : /usr/bin/test
+++ : basename
+++ : blockdev
+++ : cat
+++ : fsck
+++ : fuser
+++ : getent
+++ : grep
+++ : ifconfig
+++ : iptables
+++ : ip
+++ : mdadm
+++ : modprobe
+++ : mount
+++ : msgfmt
+++ : netstat
+++ : perl
+++ : python
+++ : raidstart
+++ : raidstop
+++ : route
+++ : umount
+++ : reboot
+++ : poweroff
+++ : wget
+++ : whoami
+++ : strings
+++ : scp
+++ : ssh
+++ : swig
+++ : gzip
+++ : tar
+++ : md5
+++ : drbdadm
+++ : drbdsetup
++ . /usr/lib/ocf/resource.d/heartbeat/.ocf-returncodes
+++ OCF_SUCCESS=0
+++ OCF_ERR_GENERIC=1
+++ OCF_ERR_ARGS=2
+++ OCF_ERR_UNIMPLEMENTED=3
+++ OCF_ERR_PERM=4
+++ OCF_ERR_INSTALLED=5
+++ OCF_ERR_CONFIGURED=6
+++ OCF_NOT_RUNNING=7
+++ OCF_RUNNING_MASTER=8
+++ OCF_FAILED_MASTER=9
++ . /usr/lib/ocf/resource.d/heartbeat/.ocf-directories
+++ prefix=/usr
+++ exec_prefix=/usr
+++ : /etc/init.d
+++ : /etc/ha.d
+++ : /etc/ha.d/rc.d
+++ : /etc/ha.d/conf
+++ : /etc/ha.d/ha.cf
+++ : /var/lib/heartbeat
+++ : /var/run/heartbeat/rsctmp
+++ : /var/lib/heartbeat/fifo
+++ : /usr/lib/heartbeat
+++ : /usr/sbin
+++ : %Y/%m/%d_%T
+++ : /dev/null
+++ : /etc/ha.d/resource.d
+++ : /usr/share/doc/heartbeat
+++ : apache
+++ : 'apache[6350]'
+++ : /var/run/
+++ : /var/lock/subsys/
++ __ocf_set_defaults validate-all
++ __OCF_ACTION=validate-all
++ unset LANG
++ LC_ALL=C
++ export LC_ALL
++ '[' -z '' ']'
++ : 0
++ '[' '!' -d /usr/lib/ocf ']'
++ '[' -z '' ']'
++ : apache
++ '[' -z '' ']'
++ : We are being invoked as an init script.
++ : Fill in some things with reasonable values.
++ : apache
++ return 0
+ HA_VARRUNDIR=/var/run/
+ IBMHTTPD=/opt/IBMHTTPServer/bin/httpd
+ HTTPDLIST='/sbin/httpd2 /usr/sbin/httpd2 /usr/sbin/apache2 /sbin/httpd
/usr/sbin/httpd /usr/sbin/apache /opt/IBMHTTPServer/bin/httpd'
+ MPM=/usr/share/apache2/find_mpm
+ '[' -x /usr/share/apache2/find_mpm ']'
+ WGETOPTS='-O- -q -L'
+ LOCALHOST=http://localhost
+ HTTPDOPTS=-DSTATUS
+ DEFAULT_IBMCONFIG=/opt/IBMHTTPServer/conf/httpd.conf
+ DEFAULT_NORMCONFIG=/etc/apache2/httpd.conf
++ basename /usr/lib/ocf/resource.d/heartbeat/apache
+ CMD=apache
+ '[' 1 -eq 1 ']'
+ COMMAND=validate-all
+ HTTPD=/usr/sbin/apache2ctl
+ PORT=
+ STATUSURL=http://localhost/server-status
+ CONFIGFILE=/etc/apache2/apache2.conf
+ OPTIONS=
+ TESTREGEX='</ *body *>[[:space:]]*</ *html *>'
+ source_envfiles /etc/apache2/envvars
+ for f in '"$@"'
+ '[' -f /etc/apache2/envvars -a -r /etc/apache2/envvars ']'
+ . /etc/apache2/envvars
++ export APACHE_RUN_USER=www-data
++ APACHE_RUN_USER=www-data
++ export APACHE_RUN_GROUP=www-data
++ APACHE_RUN_GROUP=www-data
++ export APACHE_PID_FILE=/var/run/apache2.pid
++ APACHE_PID_FILE=/var/run/apache2.pid
+ LSB_STATUS_STOPPED=3
+ '[' X/usr/sbin/apache2ctl = X -o '!' -f /usr/sbin/apache2ctl -o '!' -x
/usr/sbin/apache2ctl ']'
++ basename /usr/sbin/apache2ctl
+ httpd_basename=apache2ctl
+ case $httpd_basename in
+ case "$CONFIGFILE" in
+ '[' '!' -f /etc/apache2/apache2.conf ']'
+ '[' Xvalidate-all = Xmeta-data ']'
+ GetParams /etc/apache2/apache2.conf
+ ConfigFile=/etc/apache2/apache2.conf
+ '[' '!' -f /etc/apache2/apache2.conf ']'
+ get_apache_params /etc/apache2/apache2.conf ServerRoot PidFile Port
Listen
+ configfile=/etc/apache2/apache2.conf
+ shift 1
++ echo ServerRoot PidFile Port Listen
++ sed 's/ /,/g'
+ vars=ServerRoot,PidFile,Port,Listen
++ apachecat /etc/apache2/apache2.conf
++ awk -v vars=ServerRoot,PidFile,Port,Listen '
  BEGIN{
    split(vars,v,",");
    for( i in v )
          vl[i]=tolower(v[i]);
  }
  {
          for( i in v )
                if( tolower($1)==vl[i] ) {
                        print v[i]"="$2
                        delete vl[i]
                        break
                }
  }
  '
++ sed 's/#.*//;s/[[:blank:]]*$//;s/^[[:blank:]]*//'
++ awk '
        function procline() {
                split($0,a);
                if( a[1]=="Include" ) {
                        procinclude(a[2]);
                } else {
                        if( a[1]=="ServerRoot" ) {
                                rootdir=a[2];
                                gsub("\"","",rootdir);
                        }
                        print;
                }
        }
        function printfile(infile, a) {
                while( (getline<infile) > 0 ) {
                        procline();
                }
                close(infile);
        }
        function allfiles(dir, cmd,f) {
                cmd="find -L "dir" -type f";
                while( ( cmd | getline f ) > 0 ) {
                        printfile(f);
                }
                close(cmd);
        }
        function listfiles(pattern, cmd,f) {
                cmd="ls "pattern" 2>/dev/null";
                while( ( cmd | getline f ) > 0 ) {
                        printfile(f);
                }
                close(cmd);
        }
        function procinclude(spec) {
                if( rootdir!="" && spec!~/^\// ) {
                        spec=rootdir"/"spec;
                }
                if( isdir(spec) ) {
                        allfiles(spec); # read all files in a directory
(and subdirs)
                } else {
                        listfiles(spec); # there could be jokers
                }
        }
        function isdir(s) {
                return !system("test -d \""s"\"");
        }
        { procline(); }
++ grep -v '^$'
        ' /etc/apache2/apache2.conf
+ eval 'ServerRoot="/etc/apache2"' 'PidFile=${APACHE_PID_FILE}'
Listen=80
++ ServerRoot=/etc/apache2
++ PidFile=/var/run/apache2.pid
++ Listen=80
+ case $PidFile in
+ CheckPort ''
+ ocf_is_decimal ''
+ case "$1" in
+ false
+ PORT=
+ CheckPort ''
+ ocf_is_decimal ''
+ case "$1" in
+ false
+ PORT=80
+ '[' Xhttp://localhost/server-status = X ']'
+ test /var/run/apache2.pid
+ : OK
+ case $COMMAND in
+ validate_all_apache
+ CheckPort 80
+ ocf_is_decimal 80
+ case "$1" in
+ true
+ '[' 80 -gt 0 ']'
+ : OK
+ '[' -z http://localhost/server-status ']'
+ case $STATUSURL in
+ '[' '!' -x /usr/sbin/apache2ctl ']'
+ '[' '!' -f /etc/apache2/apache2.conf ']'
+ return 0
Checking current state
+ . /usr/lib/ocf/resource.d/heartbeat/.ocf-shellfuncs
++ unset LC_ALL
++ export LC_ALL
++ unset LANGUAGE
++ export LANGUAGE
+++ basename /usr/lib/ocf/resource.d/heartbeat/apache
++ __SCRIPT_NAME=apache
++ . /etc/ha.d/shellfuncs
+++ prefix=/usr
+++ exec_prefix=/usr
+++ : /etc/ha.d
+++ : /etc/ha.d/rc.d
+++ : /etc/ha.d/conf
+++ : /etc/ha.d/ha.cf
+++ : /var/lib/heartbeat
+++ : /var/run/heartbeat/rsctmp
+++ : /var/lib/heartbeat/fifo
+++ : /usr/lib/heartbeat
+++ : /usr/share/heartbeat
+++ : '%Y/%m/%d_%T '
+++ : /dev/null
+++ : /etc/ha.d/resource.d
+++ : /usr/share/doc/heartbeat
+++ : apache
+++ : 'apache[6384]'
+++ : /var/run/
+++ : /var/lock/subsys/
+++ : /usr/sbin
+++ export HA_DIR HA_RCDIR HA_FIFO HA_BIN
+++ export HA_DEBUGLOG HA_LOGFILE HA_LOGFACILITY
+++ export HA_DATEFMT HA_RESOURCEDIR HA_DOCDIR
+++ TESTPROG=/usr/bin/test
+++
PATH=/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++++ echo
/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/usr/l
ocal/bin:/usr/sbin:/usr/bin:/sbin:/bin
++++ sed -e s%::%% -e 's%:\.:%:%' -e 's%^:%%' -e 's%^\.:%%'
+++
PATH=/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+++ export PATH
++ '[' -z /usr/lib/ocf ']'
++ . /usr/lib/ocf/resource.d/heartbeat/.ocf-binaries
+++
PATH=/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/bin:/usr/sbin:/usr/bi
n
+++
PATH=/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/bin:/usr/sbin:/usr/bi
n:/usr/ucb
+++ export PATH
+++ : /usr/bin/mawk
+++ : '/bin/grep -E'
+++ : -a
+++ : mailx
+++ : /bin/ping
+++ :
+++ : /bin/sh
+++ : /usr/bin/test
+++ : /usr/bin/test
+++ : basename
+++ : blockdev
+++ : cat
+++ : fsck
+++ : fuser
+++ : getent
+++ : grep
+++ : ifconfig
+++ : iptables
+++ : ip
+++ : mdadm
+++ : modprobe
+++ : mount
+++ : msgfmt
+++ : netstat
+++ : perl
+++ : python
+++ : raidstart
+++ : raidstop
+++ : route
+++ : umount
+++ : reboot
+++ : poweroff
+++ : wget
+++ : whoami
+++ : strings
+++ : scp
+++ : ssh
+++ : swig
+++ : gzip
+++ : tar
+++ : md5
+++ : drbdadm
+++ : drbdsetup
++ . /usr/lib/ocf/resource.d/heartbeat/.ocf-returncodes
+++ OCF_SUCCESS=0
+++ OCF_ERR_GENERIC=1
+++ OCF_ERR_ARGS=2
+++ OCF_ERR_UNIMPLEMENTED=3
+++ OCF_ERR_PERM=4
+++ OCF_ERR_INSTALLED=5
+++ OCF_ERR_CONFIGURED=6
+++ OCF_NOT_RUNNING=7
+++ OCF_RUNNING_MASTER=8
+++ OCF_FAILED_MASTER=9
++ . /usr/lib/ocf/resource.d/heartbeat/.ocf-directories
+++ prefix=/usr
+++ exec_prefix=/usr
+++ : /etc/init.d
+++ : /etc/ha.d
+++ : /etc/ha.d/rc.d
+++ : /etc/ha.d/conf
+++ : /etc/ha.d/ha.cf
+++ : /var/lib/heartbeat
+++ : /var/run/heartbeat/rsctmp
+++ : /var/lib/heartbeat/fifo
+++ : /usr/lib/heartbeat
+++ : /usr/sbin
+++ : %Y/%m/%d_%T
+++ : /dev/null
+++ : /etc/ha.d/resource.d
+++ : /usr/share/doc/heartbeat
+++ : apache
+++ : 'apache[6384]'
+++ : /var/run/
+++ : /var/lock/subsys/
++ __ocf_set_defaults monitor
++ __OCF_ACTION=monitor
++ unset LANG
++ LC_ALL=C
++ export LC_ALL
++ '[' -z '' ']'
++ : 0
++ '[' '!' -d /usr/lib/ocf ']'
++ '[' -z '' ']'
++ : apache
++ '[' -z '' ']'
++ : We are being invoked as an init script.
++ : Fill in some things with reasonable values.
++ : apache
++ return 0
+ HA_VARRUNDIR=/var/run/
+ IBMHTTPD=/opt/IBMHTTPServer/bin/httpd
+ HTTPDLIST='/sbin/httpd2 /usr/sbin/httpd2 /usr/sbin/apache2 /sbin/httpd
/usr/sbin/httpd /usr/sbin/apache /opt/IBMHTTPServer/bin/httpd'
+ MPM=/usr/share/apache2/find_mpm
+ '[' -x /usr/share/apache2/find_mpm ']'
+ WGETOPTS='-O- -q -L'
+ LOCALHOST=http://localhost
+ HTTPDOPTS=-DSTATUS
+ DEFAULT_IBMCONFIG=/opt/IBMHTTPServer/conf/httpd.conf
+ DEFAULT_NORMCONFIG=/etc/apache2/httpd.conf
++ basename /usr/lib/ocf/resource.d/heartbeat/apache
+ CMD=apache
+ '[' 1 -eq 1 ']'
+ COMMAND=monitor
+ HTTPD=/usr/sbin/apache2ctl
+ PORT=
+ STATUSURL=http://localhost/server-status
+ CONFIGFILE=/etc/apache2/apache2.conf
+ OPTIONS=
+ TESTREGEX='</ *body *>[[:space:]]*</ *html *>'
+ source_envfiles /etc/apache2/envvars
+ for f in '"$@"'
+ '[' -f /etc/apache2/envvars -a -r /etc/apache2/envvars ']'
+ . /etc/apache2/envvars
++ export APACHE_RUN_USER=www-data
++ APACHE_RUN_USER=www-data
++ export APACHE_RUN_GROUP=www-data
++ APACHE_RUN_GROUP=www-data
++ export APACHE_PID_FILE=/var/run/apache2.pid
++ APACHE_PID_FILE=/var/run/apache2.pid
+ LSB_STATUS_STOPPED=3
+ '[' X/usr/sbin/apache2ctl = X -o '!' -f /usr/sbin/apache2ctl -o '!' -x
/usr/sbin/apache2ctl ']'
++ basename /usr/sbin/apache2ctl
+ httpd_basename=apache2ctl
+ case $httpd_basename in
+ case "$CONFIGFILE" in
+ '[' '!' -f /etc/apache2/apache2.conf ']'
+ '[' Xmonitor = Xmeta-data ']'
+ GetParams /etc/apache2/apache2.conf
+ ConfigFile=/etc/apache2/apache2.conf
+ '[' '!' -f /etc/apache2/apache2.conf ']'
+ get_apache_params /etc/apache2/apache2.conf ServerRoot PidFile Port
Listen
+ configfile=/etc/apache2/apache2.conf
+ shift 1
++ echo ServerRoot PidFile Port Listen
++ sed 's/ /,/g'
+ vars=ServerRoot,PidFile,Port,Listen
++ apachecat /etc/apache2/apache2.conf
++ awk -v vars=ServerRoot,PidFile,Port,Listen '
  BEGIN{
    split(vars,v,",");
    for( i in v )
          vl[i]=tolower(v[i]);
  }
  {
          for( i in v )
                if( tolower($1)==vl[i] ) {
                        print v[i]"="$2
                        delete vl[i]
                        break
                }
  }
  '
++ awk '
        function procline() {
                split($0,a);
                if( a[1]=="Include" ) {
                        procinclude(a[2]);
                } else {
                        if( a[1]=="ServerRoot" ) {
                                rootdir=a[2];
                                gsub("\"","",rootdir);
                        }
                        print;
                }
        }
        function printfile(infile, a) {
                while( (getline<infile) > 0 ) {
                        procline();
                }
                close(infile);
        }
        function allfiles(dir, cmd,f) {
                cmd="find -L "dir" -type f";
                while( ( cmd | getline f ) > 0 ) {
                        printfile(f);
                }
                close(cmd);
        }
        function listfiles(pattern, cmd,f) {
                cmd="ls "pattern" 2>/dev/null";
                while( ( cmd | getline f ) > 0 ) {
                        printfile(f);
                }
                close(cmd);
        }
        function procinclude(spec) {
                if( rootdir!="" && spec!~/^\// ) {
                        spec=rootdir"/"spec;
                }
                if( isdir(spec) ) {
                        allfiles(spec); # read all files in a directory
(and subdirs)
                } else {
                        listfiles(spec); # there could be jokers
                }
        }
        function isdir(s) {
                return !system("test -d \""s"\"");
        }
        { procline(); }
        ' /etc/apache2/apache2.conf
++ sed 's/#.*//;s/[[:blank:]]*$//;s/^[[:blank:]]*//'
++ grep -v '^$'
+ eval 'ServerRoot="/etc/apache2"' 'PidFile=${APACHE_PID_FILE}'
Listen=80
++ ServerRoot=/etc/apache2
++ PidFile=/var/run/apache2.pid
++ Listen=80
+ case $PidFile in
+ CheckPort ''
+ ocf_is_decimal ''
+ case "$1" in
+ false
+ PORT=
+ CheckPort ''
+ ocf_is_decimal ''
+ case "$1" in
+ false
+ PORT=80
+ '[' Xhttp://localhost/server-status = X ']'
+ test /var/run/apache2.pid
+ : OK
+ case $COMMAND in
+ monitor_apache
+ have_binary wget
++ echo wget
++ sed -e 's/ -.*//'
+ bin=wget
++ which wget
+ '[' -x /usr/bin/wget ']'
+ return 0
+ '[' -z http://localhost/server-status ']'
+ silent_status
+ '[' -f /var/run/apache2.pid ']'
+ : No pid file
+ false
+ ocf_log info 'apache not running'
+ '[' 2 -lt 2 ']'
+ __OCF_PRIO=info
+ shift
+ __OCF_MSG='apache not running'
+ case "${__OCF_PRIO}" in
+ __OCF_PRIO=INFO
+ '[' INFO = DEBUG ']'
+ ha_log 'INFO: apache not running'
+ '[' x = xyes ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
++ hadate
++ date '+%Y/%m/%d_%T '
+ Echo 2008/10/23_14:14:13 'INFO: apache not running'
+ echo 2008/10/23_14:14:13 'INFO: apache not running'
2008/10/23_14:14:13 INFO: apache not running
+ '[' -n /dev/null ']'
+ : appending to /dev/null
++ hadate
++ date '+%Y/%m/%d_%T '
+ Echo 'apache[6384]:   2008/10/23_14:14:13' 'INFO: apache not running'
+ echo 'apache[6384]:   2008/10/23_14:14:13' 'INFO: apache not running'
+ return 7
Testing: monitor
+ . /usr/lib/ocf/resource.d/heartbeat/.ocf-shellfuncs
++ unset LC_ALL
++ export LC_ALL
++ unset LANGUAGE
++ export LANGUAGE
+++ basename /usr/lib/ocf/resource.d/heartbeat/apache
++ __SCRIPT_NAME=apache
++ . /etc/ha.d/shellfuncs
+++ prefix=/usr
+++ exec_prefix=/usr
+++ : /etc/ha.d
+++ : /etc/ha.d/rc.d
+++ : /etc/ha.d/conf
+++ : /etc/ha.d/ha.cf
+++ : /var/lib/heartbeat
+++ : /var/run/heartbeat/rsctmp
+++ : /var/lib/heartbeat/fifo
+++ : /usr/lib/heartbeat
+++ : /usr/share/heartbeat
+++ : '%Y/%m/%d_%T '
+++ : /dev/null
+++ : /etc/ha.d/resource.d
+++ : /usr/share/doc/heartbeat
+++ : apache
+++ : 'apache[6425]'
+++ : /var/run/
+++ : /var/lock/subsys/
+++ : /usr/sbin
+++ export HA_DIR HA_RCDIR HA_FIFO HA_BIN
+++ export HA_DEBUGLOG HA_LOGFILE HA_LOGFACILITY
+++ export HA_DATEFMT HA_RESOURCEDIR HA_DOCDIR
+++ TESTPROG=/usr/bin/test
+++
PATH=/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++++ echo
/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/usr/l
ocal/bin:/usr/sbin:/usr/bin:/sbin:/bin
++++ sed -e s%::%% -e 's%:\.:%:%' -e 's%^:%%' -e 's%^\.:%%'
+++
PATH=/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+++ export PATH
++ '[' -z /usr/lib/ocf ']'
++ . /usr/lib/ocf/resource.d/heartbeat/.ocf-binaries
+++
PATH=/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/bin:/usr/sbin:/usr/bi
n
+++
PATH=/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/bin:/usr/sbin:/usr/bi
n:/usr/ucb
+++ export PATH
+++ : /usr/bin/mawk
+++ : '/bin/grep -E'
+++ : -a
+++ : mailx
+++ : /bin/ping
+++ :
+++ : /bin/sh
+++ : /usr/bin/test
+++ : /usr/bin/test
+++ : basename
+++ : blockdev
+++ : cat
+++ : fsck
+++ : fuser
+++ : getent
+++ : grep
+++ : ifconfig
+++ : iptables
+++ : ip
+++ : mdadm
+++ : modprobe
+++ : mount
+++ : msgfmt
+++ : netstat
+++ : perl
+++ : python
+++ : raidstart
+++ : raidstop
+++ : route
+++ : umount
+++ : reboot
+++ : poweroff
+++ : wget
+++ : whoami
+++ : strings
+++ : scp
+++ : ssh
+++ : swig
+++ : gzip
+++ : tar
+++ : md5
+++ : drbdadm
+++ : drbdsetup
++ . /usr/lib/ocf/resource.d/heartbeat/.ocf-returncodes
+++ OCF_SUCCESS=0
+++ OCF_ERR_GENERIC=1
+++ OCF_ERR_ARGS=2
+++ OCF_ERR_UNIMPLEMENTED=3
+++ OCF_ERR_PERM=4
+++ OCF_ERR_INSTALLED=5
+++ OCF_ERR_CONFIGURED=6
+++ OCF_NOT_RUNNING=7
+++ OCF_RUNNING_MASTER=8
+++ OCF_FAILED_MASTER=9
++ . /usr/lib/ocf/resource.d/heartbeat/.ocf-directories
+++ prefix=/usr
+++ exec_prefix=/usr
+++ : /etc/init.d
+++ : /etc/ha.d
+++ : /etc/ha.d/rc.d
+++ : /etc/ha.d/conf
+++ : /etc/ha.d/ha.cf
+++ : /var/lib/heartbeat
+++ : /var/run/heartbeat/rsctmp
+++ : /var/lib/heartbeat/fifo
+++ : /usr/lib/heartbeat
+++ : /usr/sbin
+++ : %Y/%m/%d_%T
+++ : /dev/null
+++ : /etc/ha.d/resource.d
+++ : /usr/share/doc/heartbeat
+++ : apache
+++ : 'apache[6425]'
+++ : /var/run/
+++ : /var/lock/subsys/
++ __ocf_set_defaults monitor
++ __OCF_ACTION=monitor
++ unset LANG
++ LC_ALL=C
++ export LC_ALL
++ '[' -z '' ']'
++ : 0
++ '[' '!' -d /usr/lib/ocf ']'
++ '[' -z '' ']'
++ : apache
++ '[' -z '' ']'
++ : We are being invoked as an init script.
++ : Fill in some things with reasonable values.
++ : apache
++ return 0
+ HA_VARRUNDIR=/var/run/
+ IBMHTTPD=/opt/IBMHTTPServer/bin/httpd
+ HTTPDLIST='/sbin/httpd2 /usr/sbin/httpd2 /usr/sbin/apache2 /sbin/httpd
/usr/sbin/httpd /usr/sbin/apache /opt/IBMHTTPServer/bin/httpd'
+ MPM=/usr/share/apache2/find_mpm
+ '[' -x /usr/share/apache2/find_mpm ']'
+ WGETOPTS='-O- -q -L'
+ LOCALHOST=http://localhost
+ HTTPDOPTS=-DSTATUS
+ DEFAULT_IBMCONFIG=/opt/IBMHTTPServer/conf/httpd.conf
+ DEFAULT_NORMCONFIG=/etc/apache2/httpd.conf
++ basename /usr/lib/ocf/resource.d/heartbeat/apache
+ CMD=apache
+ '[' 1 -eq 1 ']'
+ COMMAND=monitor
+ HTTPD=/usr/sbin/apache2ctl
+ PORT=
+ STATUSURL=http://localhost/server-status
+ CONFIGFILE=/etc/apache2/apache2.conf
+ OPTIONS=
+ TESTREGEX='</ *body *>[[:space:]]*</ *html *>'
+ source_envfiles /etc/apache2/envvars
+ for f in '"$@"'
+ '[' -f /etc/apache2/envvars -a -r /etc/apache2/envvars ']'
+ . /etc/apache2/envvars
++ export APACHE_RUN_USER=www-data
++ APACHE_RUN_USER=www-data
++ export APACHE_RUN_GROUP=www-data
++ APACHE_RUN_GROUP=www-data
++ export APACHE_PID_FILE=/var/run/apache2.pid
++ APACHE_PID_FILE=/var/run/apache2.pid
+ LSB_STATUS_STOPPED=3
+ '[' X/usr/sbin/apache2ctl = X -o '!' -f /usr/sbin/apache2ctl -o '!' -x
/usr/sbin/apache2ctl ']'
++ basename /usr/sbin/apache2ctl
+ httpd_basename=apache2ctl
+ case $httpd_basename in
+ case "$CONFIGFILE" in
+ '[' '!' -f /etc/apache2/apache2.conf ']'
+ '[' Xmonitor = Xmeta-data ']'
+ GetParams /etc/apache2/apache2.conf
+ ConfigFile=/etc/apache2/apache2.conf
+ '[' '!' -f /etc/apache2/apache2.conf ']'
+ get_apache_params /etc/apache2/apache2.conf ServerRoot PidFile Port
Listen
+ configfile=/etc/apache2/apache2.conf
+ shift 1
++ echo ServerRoot PidFile Port Listen
++ sed 's/ /,/g'
+ vars=ServerRoot,PidFile,Port,Listen
++ apachecat /etc/apache2/apache2.conf
++ awk -v vars=ServerRoot,PidFile,Port,Listen '
  BEGIN{
    split(vars,v,",");
    for( i in v )
          vl[i]=tolower(v[i]);
  }
  {
          for( i in v )
                if( tolower($1)==vl[i] ) {
                        print v[i]"="$2
                        delete vl[i]
                        break
                }
  }
  '
++ awk '
        function procline() {
                split($0,a);
                if( a[1]=="Include" ) {
                        procinclude(a[2]);
                } else {
                        if( a[1]=="ServerRoot" ) {
                                rootdir=a[2];
                                gsub("\"","",rootdir);
                        }
                        print;
                }
        }
        function printfile(infile, a) {
                while( (getline<infile) > 0 ) {
                        procline();
                }
                close(infile);
        }
        function allfiles(dir, cmd,f) {
                cmd="find -L "dir" -type f";
                while( ( cmd | getline f ) > 0 ) {
                        printfile(f);
                }
                close(cmd);
        }
        function listfiles(pattern, cmd,f) {
                cmd="ls "pattern" 2>/dev/null";
                while( ( cmd | getline f ) > 0 ) {
                        printfile(f);
                }
                close(cmd);
        }
        function procinclude(spec) {
                if( rootdir!="" && spec!~/^\// ) {
                        spec=rootdir"/"spec;
                }
                if( isdir(spec) ) {
                        allfiles(spec); # read all files in a directory
(and subdirs)
                } else {
                        listfiles(spec); # there could be jokers
                }
        }
        function isdir(s) {
                return !system("test -d \""s"\"");
        }
        { procline(); }
        ' /etc/apache2/apache2.conf
++ sed 's/#.*//;s/[[:blank:]]*$//;s/^[[:blank:]]*//'
++ grep -v '^$'
+ eval 'ServerRoot="/etc/apache2"' 'PidFile=${APACHE_PID_FILE}'
Listen=80
++ ServerRoot=/etc/apache2
++ PidFile=/var/run/apache2.pid
++ Listen=80
+ case $PidFile in
+ CheckPort ''
+ ocf_is_decimal ''
+ case "$1" in
+ false
+ PORT=
+ CheckPort ''
+ ocf_is_decimal ''
+ case "$1" in
+ false
+ PORT=80
+ '[' Xhttp://localhost/server-status = X ']'
+ test /var/run/apache2.pid
+ : OK
+ case $COMMAND in
+ monitor_apache
+ have_binary wget
++ echo wget
++ sed -e 's/ -.*//'
+ bin=wget
++ which wget
+ '[' -x /usr/bin/wget ']'
+ return 0
+ '[' -z http://localhost/server-status ']'
+ silent_status
+ '[' -f /var/run/apache2.pid ']'
+ : No pid file
+ false
+ ocf_log info 'apache not running'
+ '[' 2 -lt 2 ']'
+ __OCF_PRIO=info
+ shift
+ __OCF_MSG='apache not running'
+ case "${__OCF_PRIO}" in
+ __OCF_PRIO=INFO
+ '[' INFO = DEBUG ']'
+ ha_log 'INFO: apache not running'
+ '[' x = xyes ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
++ hadate
++ date '+%Y/%m/%d_%T '
+ Echo 2008/10/23_14:14:13 'INFO: apache not running'
+ echo 2008/10/23_14:14:13 'INFO: apache not running'
2008/10/23_14:14:13 INFO: apache not running
+ '[' -n /dev/null ']'
+ : appending to /dev/null
++ hadate
++ date '+%Y/%m/%d_%T '
+ Echo 'apache[6425]:   2008/10/23_14:14:13' 'INFO: apache not running'
+ echo 'apache[6425]:   2008/10/23_14:14:13' 'INFO: apache not running'
+ return 7
Testing: start
+ . /usr/lib/ocf/resource.d/heartbeat/.ocf-shellfuncs
++ unset LC_ALL
++ export LC_ALL
++ unset LANGUAGE
++ export LANGUAGE
+++ basename /usr/lib/ocf/resource.d/heartbeat/apache
++ __SCRIPT_NAME=apache
++ . /etc/ha.d/shellfuncs
+++ prefix=/usr
+++ exec_prefix=/usr
+++ : /etc/ha.d
+++ : /etc/ha.d/rc.d
+++ : /etc/ha.d/conf
+++ : /etc/ha.d/ha.cf
+++ : /var/lib/heartbeat
+++ : /var/run/heartbeat/rsctmp
+++ : /var/lib/heartbeat/fifo
+++ : /usr/lib/heartbeat
+++ : /usr/share/heartbeat
+++ : '%Y/%m/%d_%T '
+++ : /dev/null
+++ : /etc/ha.d/resource.d
+++ : /usr/share/doc/heartbeat
+++ : apache
+++ : 'apache[6466]'
+++ : /var/run/
+++ : /var/lock/subsys/
+++ : /usr/sbin
+++ export HA_DIR HA_RCDIR HA_FIFO HA_BIN
+++ export HA_DEBUGLOG HA_LOGFILE HA_LOGFACILITY
+++ export HA_DATEFMT HA_RESOURCEDIR HA_DOCDIR
+++ TESTPROG=/usr/bin/test
+++
PATH=/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++++ echo
/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/usr/l
ocal/bin:/usr/sbin:/usr/bin:/sbin:/bin
++++ sed -e s%::%% -e 's%:\.:%:%' -e 's%^:%%' -e 's%^\.:%%'
+++
PATH=/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+++ export PATH
++ '[' -z /usr/lib/ocf ']'
++ . /usr/lib/ocf/resource.d/heartbeat/.ocf-binaries
+++
PATH=/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/bin:/usr/sbin:/usr/bi
n
+++
PATH=/usr/lib/heartbeat:/usr/sbin:/usr/share/heartbeat:/usr/local/sbin:/
usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/bin:/usr/sbin:/usr/bi
n:/usr/ucb
+++ export PATH
+++ : /usr/bin/mawk
+++ : '/bin/grep -E'
+++ : -a
+++ : mailx
+++ : /bin/ping
+++ :
+++ : /bin/sh
+++ : /usr/bin/test
+++ : /usr/bin/test
+++ : basename
+++ : blockdev
+++ : cat
+++ : fsck
+++ : fuser
+++ : getent
+++ : grep
+++ : ifconfig
+++ : iptables
+++ : ip
+++ : mdadm
+++ : modprobe
+++ : mount
+++ : msgfmt
+++ : netstat
+++ : perl
+++ : python
+++ : raidstart
+++ : raidstop
+++ : route
+++ : umount
+++ : reboot
+++ : poweroff
+++ : wget
+++ : whoami
+++ : strings
+++ : scp
+++ : ssh
+++ : swig
+++ : gzip
+++ : tar
+++ : md5
+++ : drbdadm
+++ : drbdsetup
++ . /usr/lib/ocf/resource.d/heartbeat/.ocf-returncodes
+++ OCF_SUCCESS=0
+++ OCF_ERR_GENERIC=1
+++ OCF_ERR_ARGS=2
+++ OCF_ERR_UNIMPLEMENTED=3
+++ OCF_ERR_PERM=4
+++ OCF_ERR_INSTALLED=5
+++ OCF_ERR_CONFIGURED=6
+++ OCF_NOT_RUNNING=7
+++ OCF_RUNNING_MASTER=8
+++ OCF_FAILED_MASTER=9
++ . /usr/lib/ocf/resource.d/heartbeat/.ocf-directories
+++ prefix=/usr
+++ exec_prefix=/usr
+++ : /etc/init.d
+++ : /etc/ha.d
+++ : /etc/ha.d/rc.d
+++ : /etc/ha.d/conf
+++ : /etc/ha.d/ha.cf
+++ : /var/lib/heartbeat
+++ : /var/run/heartbeat/rsctmp
+++ : /var/lib/heartbeat/fifo
+++ : /usr/lib/heartbeat
+++ : /usr/sbin
+++ : %Y/%m/%d_%T
+++ : /dev/null
+++ : /etc/ha.d/resource.d
+++ : /usr/share/doc/heartbeat
+++ : apache
+++ : 'apache[6466]'
+++ : /var/run/
+++ : /var/lock/subsys/
++ __ocf_set_defaults start
++ __OCF_ACTION=start
++ unset LANG
++ LC_ALL=C
++ export LC_ALL
++ '[' -z '' ']'
++ : 0
++ '[' '!' -d /usr/lib/ocf ']'
++ '[' -z '' ']'
++ : apache
++ '[' -z '' ']'
++ : We are being invoked as an init script.
++ : Fill in some things with reasonable values.
++ : apache
++ return 0
+ HA_VARRUNDIR=/var/run/
+ IBMHTTPD=/opt/IBMHTTPServer/bin/httpd
+ HTTPDLIST='/sbin/httpd2 /usr/sbin/httpd2 /usr/sbin/apache2 /sbin/httpd
/usr/sbin/httpd /usr/sbin/apache /opt/IBMHTTPServer/bin/httpd'
+ MPM=/usr/share/apache2/find_mpm
+ '[' -x /usr/share/apache2/find_mpm ']'
+ WGETOPTS='-O- -q -L'
+ LOCALHOST=http://localhost
+ HTTPDOPTS=-DSTATUS
+ DEFAULT_IBMCONFIG=/opt/IBMHTTPServer/conf/httpd.conf
+ DEFAULT_NORMCONFIG=/etc/apache2/httpd.conf
++ basename /usr/lib/ocf/resource.d/heartbeat/apache
+ CMD=apache
+ '[' 1 -eq 1 ']'
+ COMMAND=start
+ HTTPD=/usr/sbin/apache2ctl
+ PORT=
+ STATUSURL=http://localhost/server-status
+ CONFIGFILE=/etc/apache2/apache2.conf
+ OPTIONS=
+ TESTREGEX='</ *body *>[[:space:]]*</ *html *>'
+ source_envfiles /etc/apache2/envvars
+ for f in '"$@"'
+ '[' -f /etc/apache2/envvars -a -r /etc/apache2/envvars ']'
+ . /etc/apache2/envvars
++ export APACHE_RUN_USER=www-data
++ APACHE_RUN_USER=www-data
++ export APACHE_RUN_GROUP=www-data
++ APACHE_RUN_GROUP=www-data
++ export APACHE_PID_FILE=/var/run/apache2.pid
++ APACHE_PID_FILE=/var/run/apache2.pid
+ LSB_STATUS_STOPPED=3
+ '[' X/usr/sbin/apache2ctl = X -o '!' -f /usr/sbin/apache2ctl -o '!' -x
/usr/sbin/apache2ctl ']'
++ basename /usr/sbin/apache2ctl
+ httpd_basename=apache2ctl
+ case $httpd_basename in
+ case "$CONFIGFILE" in
+ '[' '!' -f /etc/apache2/apache2.conf ']'
+ '[' Xstart = Xmeta-data ']'
+ GetParams /etc/apache2/apache2.conf
+ ConfigFile=/etc/apache2/apache2.conf
+ '[' '!' -f /etc/apache2/apache2.conf ']'
+ get_apache_params /etc/apache2/apache2.conf ServerRoot PidFile Port
Listen
+ configfile=/etc/apache2/apache2.conf
+ shift 1
++ echo ServerRoot PidFile Port Listen
++ sed 's/ /,/g'
+ vars=ServerRoot,PidFile,Port,Listen
++ apachecat /etc/apache2/apache2.conf
++ awk -v vars=ServerRoot,PidFile,Port,Listen '
  BEGIN{
    split(vars,v,",");
    for( i in v )
          vl[i]=tolower(v[i]);
  }
  {
          for( i in v )
                if( tolower($1)==vl[i] ) {
                        print v[i]"="$2
                        delete vl[i]
                        break
                }
  }
  '
++ awk '
        function procline() {
                split($0,a);
                if( a[1]=="Include" ) {
                        procinclude(a[2]);
                } else {
                        if( a[1]=="ServerRoot" ) {
                                rootdir=a[2];
                                gsub("\"","",rootdir);
                        }
                        print;
                }
        }
        function printfile(infile, a) {
                while( (getline<infile) > 0 ) {
                        procline();
                }
                close(infile);
        }
        function allfiles(dir, cmd,f) {
                cmd="find -L "dir" -type f";
                while( ( cmd | getline f ) > 0 ) {
                        printfile(f);
                }
                close(cmd);
        }
        function listfiles(pattern, cmd,f) {
                cmd="ls "pattern" 2>/dev/null";
                while( ( cmd | getline f ) > 0 ) {
                        printfile(f);
                }
                close(cmd);
        }
        function procinclude(spec) {
                if( rootdir!="" && spec!~/^\// ) {
                        spec=rootdir"/"spec;
                }
                if( isdir(spec) ) {
                        allfiles(spec); # read all files in a directory
(and subdirs)
                } else {
                        listfiles(spec); # there could be jokers
                }
        }
        function isdir(s) {
                return !system("test -d \""s"\"");
        }
        { procline(); }
        ' /etc/apache2/apache2.conf
++ sed 's/#.*//;s/[[:blank:]]*$//;s/^[[:blank:]]*//'
++ grep -v '^$'
+ eval 'ServerRoot="/etc/apache2"' 'PidFile=${APACHE_PID_FILE}'
Listen=80
++ ServerRoot=/etc/apache2
++ PidFile=/var/run/apache2.pid
++ Listen=80
+ case $PidFile in
+ CheckPort ''
+ ocf_is_decimal ''
+ case "$1" in
+ false
+ PORT=
+ CheckPort ''
+ ocf_is_decimal ''
+ case "$1" in
+ false
+ PORT=80
+ '[' Xhttp://localhost/server-status = X ']'
+ test /var/run/apache2.pid
+ : OK
+ case $COMMAND in
+ start_apache
+ silent_status
+ '[' -f /var/run/apache2.pid ']'
+ : No pid file
+ false
+ ocf_run /usr/sbin/apache2ctl -DSTATUS -f /etc/apache2/apache2.conf
++ /usr/sbin/apache2ctl -DSTATUS -f /etc/apache2/apache2.conf
+ output=
+ rc=0
++ echo
+ output=
+ '[' 0 -eq 0 ']'
+ '[' '!' -z '' ']'
+ return 0
+ tries=0
+ :
+ monitor_apache
+ have_binary wget
++ echo wget
++ sed -e 's/ -.*//'
+ bin=wget
++ which wget
+ '[' -x /usr/bin/wget ']'
+ return 0
+ '[' -z http://localhost/server-status ']'
+ silent_status
+ '[' -f /var/run/apache2.pid ']'
+ : No pid file
+ false
+ ocf_log info 'apache not running'
+ '[' 2 -lt 2 ']'
+ __OCF_PRIO=info
+ shift
+ __OCF_MSG='apache not running'
+ case "${__OCF_PRIO}" in
+ __OCF_PRIO=INFO
+ '[' INFO = DEBUG ']'
+ ha_log 'INFO: apache not running'
+ '[' x = xyes ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
++ hadate
++ date '+%Y/%m/%d_%T '
+ Echo 2008/10/23_14:14:14 'INFO: apache not running'
+ echo 2008/10/23_14:14:14 'INFO: apache not running'
2008/10/23_14:14:14 INFO: apache not running
+ '[' -n /dev/null ']'
+ : appending to /dev/null
++ hadate
++ date '+%Y/%m/%d_%T '
+ Echo 'apache[6466]:   2008/10/23_14:14:14' 'INFO: apache not running'
+ echo 'apache[6466]:   2008/10/23_14:14:14' 'INFO: apache not running'
+ return 7
+ ec=7
+ '[' 7 -eq 7 ']'
++ expr 0 + 1
+ tries=1
+ ocf_log info 'waiting for apache /etc/apache2/apache2.conf to come up'
+ '[' 2 -lt 2 ']'
+ __OCF_PRIO=info
+ shift
+ __OCF_MSG='waiting for apache /etc/apache2/apache2.conf to come up'
+ case "${__OCF_PRIO}" in
+ __OCF_PRIO=INFO
+ '[' INFO = DEBUG ']'
+ ha_log 'INFO: waiting for apache /etc/apache2/apache2.conf to come up'
+ '[' x = xyes ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
++ hadate
++ date '+%Y/%m/%d_%T '
+ Echo 2008/10/23_14:14:14 'INFO: waiting for apache
/etc/apache2/apache2.conf to come up'
+ echo 2008/10/23_14:14:14 'INFO: waiting for apache
/etc/apache2/apache2.conf to come up'
2008/10/23_14:14:14 INFO: waiting for apache /etc/apache2/apache2.conf
to come up
+ '[' -n /dev/null ']'
+ : appending to /dev/null
++ hadate
++ date '+%Y/%m/%d_%T '
+ Echo 'apache[6466]:   2008/10/23_14:14:14' 'INFO: waiting for apache
/etc/apache2/apache2.conf to come up'
+ echo 'apache[6466]:   2008/10/23_14:14:14' 'INFO: waiting for apache
/etc/apache2/apache2.conf to come up'
+ sleep 1
^C
db1:/var/tmp/xml#




db1:/var/tmp/xml# which wget
/usr/bin/wget
db1:/var/tmp/xml#
db1:/var/tmp/xml# ps aux|grep apach
root      3109  0.0  0.0  20884  1736 pts/4    S+   13:07   0:00 vi
/usr/lib/ocf/resource.d/heartbeat/apache
root      6503  0.0  0.1 137728  7212 ?        Ss   14:14   0:00
/usr/sbin/apache2 -DSTATUS -f /etc/apache2/apache2.conf
www-data  6514  0.0  0.1 137728  4456 ?        S    14:14   0:00
/usr/sbin/apache2 -DSTATUS -f /etc/apache2/apache2.conf
www-data  6515  0.0  0.1 137728  4456 ?        S    14:14   0:00
/usr/sbin/apache2 -DSTATUS -f /etc/apache2/apache2.conf
www-data  6517  0.0  0.1 137728  4456 ?        S    14:14   0:00
/usr/sbin/apache2 -DSTATUS -f /etc/apache2/apache2.conf
www-data  6519  0.0  0.1 137728  4456 ?        S    14:14   0:00
/usr/sbin/apache2 -DSTATUS -f /etc/apache2/apache2.conf
www-data  6520  0.0  0.1 137728  4456 ?        S    14:14   0:00
/usr/sbin/apache2 -DSTATUS -f /etc/apache2/apache2.conf
root      6528  0.0  0.0   5160   776 pts/2    R+   14:15   0:00 grep
apach
db1:/var/tmp/xml#
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to