[ClusterLabs] ocf:heartbeart:apache and systemd

Chuck Carmack carmack at us.ibm.com
Fri Mar 20 17:09:54 UTC 2015


Hi,

I'm on a RHEL7 system and noticing some problems starting and stopping 
apache using systemctl vs. using pcs.
The problems are with the $MAINPID env var used httpd.service.

Here are some examples:

1) start apache with "pcs resoruce enable httpd"

2) Attempt to stop apache with "systemctl stop httpd.service"
--> nothing happens, apache is still running, no error from systemctl
--> this must be because the MainPid used by httpd.service is not correct, 
so the "kill WINCH ${MAINPID}" doesn't work

3) Attempt to start apache using "systemctl start httpd.service"
--> fails with:
systemctl status httpd.service
httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
   Active: failed (Result: exit-code) since Fri 2015-03-20 11:04:03 CDT; 
8s ago
  Process: 25653 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, 
status=1/FAILURE)
  Process: 25638 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND 
(code=exited, status=0/SUCCESS)
 Main PID: 25638 (code=exited, status=0/SUCCESS)

Mar 20 11:04:03 vs404.rch.kstart.ibm.com httpd[25638]: httpd (pid 25202) 
already running
Mar 20 11:04:03 vs404.rch.kstart.ibm.com kill[25653]: kill: cannot find 
process ""
Mar 20 11:04:03 vs404.rch.kstart.ibm.com systemd[1]: httpd.service: 
control process exited, code=exited status=1
Mar 20 11:04:03 vs404.rch.kstart.ibm.com systemd[1]: Failed to start The 
Apache HTTP Server.
Mar 20 11:04:03 vs404.rch.kstart.ibm.com systemd[1]: Unit httpd.service 
entered failed state.
--> note, the same error happens on restart

--> Workaround:  I added a custom file for httpd.service containing these 
lines:
[Service]
PIDFile=/var/run/httpd/httpd.pid
--> did a "systemctl daemon-reload", and now "systemctl start 
httpd.service" or restart works

4) Now stop httpd using "systemctl stop httpd.service"
--> The command works, and pacemaker restarts apache as it should, however 
the MAINPID is now wrong,
so we back to step (2)

Questions:
-- Are there plans to better integrate ocf:heartbeat:apache with systemd? 
Or are users expected to
do the workaround as I did?
-- Are there other integration issues with systemd?
-- I'd like to workaround the problem in step (2) (stop does nothing).  I 
think I can customize
ExecStop in httpd.service but havne't figured out how.  Any advice how to 
do this?

Thanks..
Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clusterlabs.org/pipermail/users/attachments/20150320/8c2736b9/attachment-0003.html>


More information about the Users mailing list