RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 915050 - ocf:heartbeat:apache resource not working
Summary: ocf:heartbeat:apache resource not working
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: resource-agents
Version: 7.0
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: ---
Assignee: David Vossel
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On: 799065
Blocks: 883874 1080147
TreeView+ depends on / blocked
 
Reported: 2013-02-24 13:26 UTC by michal novacek
Modified: 2014-06-17 23:55 UTC (History)
4 users (show)

Fixed In Version: resource-agents-3.9.5-3.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 11:42:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
"cibadmin --query" output from the first node (9.84 KB, text/xml)
2013-02-24 13:26 UTC, michal novacek
no flags Details
workaround for incorrect pid guessing (483 bytes, text/plain)
2013-02-28 16:44 UTC, michal novacek
no flags Details
example httpd.conf (11.57 KB, text/plain)
2013-06-14 15:20 UTC, David Vossel
no flags Details

Description michal novacek 2013-02-24 13:26:55 UTC
Created attachment 702003 [details]
"cibadmin --query" output from the first node

Description of problem:
Cluster resource ocf:heartbeat:apache does not run.

Version-Release number of selected component (if applicable):
resource-agents-3.9.2-5.el7.x86_64
RHEL-7.0-20130131.0  

How reproducible:
always

Steps to Reproduce:
1. have running corosync+pacemaker cluster
2. pcs resource create haa-apache ocf:heartbeat:apache params \
configfile=/etc/httpd/conf/httpd.conf op monitor interval=30s
3. pcs resource start ha-apache
  
Actual results:
resource in stopped state.

Expected results:
resource in running state. logging of what went wrong.

Additional info:

aa-node01:~]$ pcs status
Last updated: Sun Feb 24 07:01:19 2013
Last change: Sun Feb 24 07:07:47 2013 via cibadmin on aa-node01
Stack: corosync
Current DC: aa-node02 (2) - partition with quorum
Version: 1.1.8-4.el7-5db5f53
2 Nodes configured, unknown expected votes
1 Resources configured.

Online: [ aa-node01 aa-node02 ]
Full list of resources:
 virt-fencing   (stonith:fence_xvm):    Started aa-node01

aa-node01:~]$ pcs resource create haa-apache ocf:heartbeat:apache params \
configfile=/etc/httpd/conf/httpd.conf op monitor interval=30s

aa-node01:~]$ pcs status
Last updated: Sun Feb 24 07:05:41 2013
Last change: Sun Feb 24 07:09:35 2013 via cibadmin on aa-node01
Stack: corosync
Current DC: aa-node02 (2) - partition with quorum
Version: 1.1.8-4.el7-5db5f53
2 Nodes configured, unknown expected votes
2 Resources configured.

Online: [ aa-node01 aa-node02 ]
Full list of resources:
 virt-fencing   (stonith:fence_xvm):    Started aa-node01
 haa-apache     (ocf::heartbeat:apache):        Stopped 

Failed actions:
    haa-apache_start_0 (node=aa-node01, call=78, rc=1, status=Timed Out): unknown error
    haa-apache_start_0 (node=aa-node02, call=94, rc=1, status=Timed Out): unknown error

aa-node01:~]$ pcs resource show haa-apache
Resource: haa-apache
  configfile: /etc/httpd/conf/httpd.conf
  op monitor interval=30s

aa-node01:~]$ pcs resource start haa-apache

aa-node01:~]$ pcs status
Last updated: Sun Feb 24 07:06:31 2013
Last change: Sun Feb 24 07:09:35 2013 via cibadmin on aa-node01
Stack: corosync
Current DC: aa-node02 (2) - partition with quorum
Version: 1.1.8-4.el7-5db5f53
2 Nodes configured, unknown expected votes
2 Resources configured.

Online: [ aa-node01 aa-node02 ]
Full list of resources:
 virt-fencing   (stonith:fence_xvm):    Started aa-node01
 haa-apache     (ocf::heartbeat:apache):        Stopped 

Failed actions:
    haa-apache_start_0 (node=aa-node01, call=78, rc=1, status=Timed Out): unknown error
    haa-apache_start_0 (node=aa-node02, call=94, rc=1, status=Timed Out): unknown error

Comment 2 michal novacek 2013-02-28 16:43:46 UTC
The problem seems to be caused by these two things:

1/ ocf:heartbeat:apache resource incorectly guess pid file of httpd 

It previously worked in RHEL6.4 because "PidFile=" has been in httpd.conf by
default and now it's not. It is guessed with the other 'case:' case which is to
take $HA_VARRUN/${httpd_basename}.pid (from
/usr/lib/ocf/lib/heartbeat/ocf-directories) which results incorrectly to
/var/run/httpd.pid where it should be /var/run/http/httpd.pid.

Therefore the script never sees httpd running and it is quite hard to find why
it is not starting.

2/ bz799065 -- adding it as blocker

Comment 3 michal novacek 2013-02-28 16:44:42 UTC
Created attachment 703926 [details]
workaround for incorrect pid guessing

Comment 6 David Vossel 2013-03-11 22:35:59 UTC
A patch has been committed for this upstream.

https://github.com/davidvossel/resource-agents/commit/2ce0b97d3009b4f0c94d0db83fd68b311de7bc85

Comment 7 michal novacek 2013-06-14 14:32:29 UTC
I took rhel7.0-20130502, created two-node cluster and installed apache2. I did
not change anything in httpd.conf so there is no PidFile line in there.

# pcs resource show haa-apache
Resource: haa-apache
  configfile: /etc/httpd/conf/httpd.conf
  op monitor interval=30s

# pcs resource start haa-apache

# pcs status
Cluster name: STSRHTS20736
Last updated: Fri Jun 14 16:26:34 2013
Last change: Fri Jun 14 16:25:39 2013 via cibadmin on virt-001.cluster-qe.lab.eng.brq.redhat.com
Stack: corosync
Current DC: virt-002.cluster-qe.lab.eng.brq.redhat.com (2) - partition with quorum
Version: 1.1.10-1.el7-138556c
2 Nodes configured, unknown expected votes
2 Resources configured.


Online: [ virt-001.cluster-qe.lab.eng.brq.redhat.com virt-002.cluster-qe.lab.eng.brq.redhat.com ]

Full list of resources:

 virt-fencing   (stonith:fence_xvm):    Started virt-001.cluster-qe.lab.eng.brq.redhat.com 
 haa-apache     (ocf::heartbeat:apache):        Stopped 

Failed actions:
    haa-apache_start_0 (node=virt-002.cluster-qe.lab.eng.brq.redhat.com, call=39, rc=1, status=complete): unknown error
    haa-apache_start_0 (node=virt-001.cluster-qe.lab.eng.brq.redhat.com, call=42, rc=1, status=complete): unknown error

# tail /var/log/httpd/error_log

... [core:notice] [pid 12312] SELinux policy enabled; httpd running as context unconfined_u:system_r:unconfined_t:s0-s0:c0.c1023
... [suexec:notice] [pid 12312] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
... [auth_digest:notice] [pid 12313] AH01757: generating secret for digest authentication ...
... [lbmethod_heartbeat:notice] [pid 12313] AH02282: No slotmem from mod_heartmonitor
... [mpm_prefork:notice] [pid 12313] AH00163: Apache/2.4.4 (Red Hat) configured -- resuming normal operations
... [core:notice] [pid 12313] AH00094: Command line: '/sbin/httpd -D STATUS -f /etc/httpd/conf/httpd.conf -c PidFile /var/run//httpd.pid'
... [mpm_prefork:notice] [pid 12313] AH00169: caught SIGTERM, shutting down

It seems that patch did its work and added "-c Pidfile /var/run/httd.pid" but
resource is still not started. What am I doing wrong?

It works when there is "PidFile ..." line in httpd.conf but as far as I know it
is not mandatory so the resource should not depend on it.

Comment 8 David Vossel 2013-06-14 15:18:57 UTC
This is working for me. Did you set the status url in the httpd.conf file?

http://clusterlabs.org/doc/en-US/Pacemaker/1.1-pcs/html-single/Clusters_from_Scratch/index.html#_enable_the_apache_status_url

I'll attach my httpd.conf.

Comment 9 David Vossel 2013-06-14 15:20:22 UTC
Created attachment 761316 [details]
example httpd.conf

Comment 10 michal novacek 2013-06-14 15:42:23 UTC
My bad.

It is need to enable server-status location and create resource with it. With
this done apache runs nicely even without "PidFile ..." line in httpd config.

GOOD version: resource-agents-3.9.5-4.el7.x86_64

# cat /etc/httpd/conf.d/server-status.conf 
<Location /server-status>
   SetHandler server-status
   Order deny,allow
   Deny from all
   Allow from 127.0.0.1
</Location>

# pcs resource show haa-apache
 Resource: haa-apache (class=ocf provider=heartbeat type=apache)
  Attributes: configfile=/etc/httpd/conf/httpd.conf statusurl=http://localhost/server-status 
  Operations: monitor interval=30s (haa-apache-monitor-interval-30s)

# pcs status
Cluster name: STSRHTS20736
Last updated: Fri Jun 14 17:40:02 2013
Last change: Fri Jun 14 17:36:29 2013 via cibadmin on virt-001.cluster-qe.lab.eng.brq.redhat.com
Stack: corosync
Current DC: virt-002.cluster-qe.lab.eng.brq.redhat.com (2) - partition with quorum
Version: 1.1.10-1.el7-138556c
2 Nodes configured, unknown expected votes
2 Resources configured.

Online: [ virt-001.cluster-qe.lab.eng.brq.redhat.com virt-002.cluster-qe.lab.eng.brq.redhat.com ]

Full list of resources:

 virt-fencing   (stonith:fence_xvm):    Started virt-001.cluster-qe.lab.eng.brq.redhat.com 
 haa-apache     (ocf::heartbeat:apache):        Started virt-002.cluster-qe.lab.eng.brq.redhat.com

Comment 11 David Vossel 2013-06-14 16:26:21 UTC
The fact you hit this status-url error with no indication as to what the problem was means there's room for improvement.  I'm adding error output to this agent to make the problem more obvious.

Comment 12 Ludek Smid 2014-06-13 11:42:03 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


Note You need to log in before you can comment on or make changes to this bug.