<font size=2 face="sans-serif">Hi,</font>
<br>
<br><font size=2 face="sans-serif">I'm on a RHEL7 system and noticing some
problems starting and stopping apache using systemctl vs. using pcs.</font>
<br><font size=2 face="sans-serif">The problems are with the $MAINPID env
var used httpd.service.</font>
<br>
<br><font size=2 face="sans-serif">Here are some examples:</font>
<br>
<br><font size=2 face="sans-serif">1) start apache with "pcs resoruce
enable httpd"</font>
<br>
<br><font size=2 face="sans-serif">2) Attempt to stop apache with "systemctl
stop httpd.service"</font>
<br><font size=2 face="sans-serif">--> nothing happens, apache is still
running, no error from systemctl</font>
<br><font size=2 face="sans-serif">--> this must be because the MainPid
used by httpd.service is not correct, so the "kill WINCH ${MAINPID}"
doesn't work</font>
<br>
<br><font size=2 face="sans-serif">3) Attempt to start apache using "systemctl
start httpd.service"</font>
<br><font size=2 face="sans-serif">--> fails with:</font>
<br><font size=2 face="sans-serif">systemctl status httpd.service</font>
<br><font size=2 face="sans-serif">httpd.service - The Apache HTTP Server</font>
<br><font size=2 face="sans-serif"> Loaded: loaded (/usr/lib/systemd/system/httpd.service;
enabled)</font>
<br><font size=2 face="sans-serif"> Active: failed (Result:
exit-code) since Fri 2015-03-20 11:04:03 CDT; 8s ago</font>
<br><font size=2 face="sans-serif"> Process: 25653 ExecStop=/bin/kill
-WINCH ${MAINPID} (code=exited, status=1/FAILURE)</font>
<br><font size=2 face="sans-serif"> Process: 25638 ExecStart=/usr/sbin/httpd
$OPTIONS -DFOREGROUND (code=exited, status=0/SUCCESS)</font>
<br><font size=2 face="sans-serif"> Main PID: 25638 (code=exited,
status=0/SUCCESS)</font>
<br>
<br><font size=2 face="sans-serif">Mar 20 11:04:03 vs404.rch.kstart.ibm.com
httpd[25638]: httpd (pid 25202) already running</font>
<br><font size=2 face="sans-serif">Mar 20 11:04:03 vs404.rch.kstart.ibm.com
kill[25653]: kill: cannot find process ""</font>
<br><font size=2 face="sans-serif">Mar 20 11:04:03 vs404.rch.kstart.ibm.com
systemd[1]: httpd.service: control process exited, code=exited status=1</font>
<br><font size=2 face="sans-serif">Mar 20 11:04:03 vs404.rch.kstart.ibm.com
systemd[1]: Failed to start The Apache HTTP Server.</font>
<br><font size=2 face="sans-serif">Mar 20 11:04:03 vs404.rch.kstart.ibm.com
systemd[1]: Unit httpd.service entered failed state.</font>
<br><font size=2 face="sans-serif">--> note, the same error happens
on restart</font>
<br>
<br><font size=2 face="sans-serif">--> Workaround: I added a custom
file for httpd.service containing these lines:</font>
<br><font size=2 face="sans-serif">[Service]</font>
<br><font size=2 face="sans-serif">PIDFile=/var/run/httpd/httpd.pid</font>
<br><font size=2 face="sans-serif">--> did a "systemctl daemon-reload",
and now "systemctl start httpd.service" or restart works</font>
<br>
<br><font size=2 face="sans-serif">4) Now stop httpd using "systemctl
stop httpd.service"</font>
<br><font size=2 face="sans-serif">--> The command works, and pacemaker
restarts apache as it should, however the MAINPID is now wrong,</font>
<br><font size=2 face="sans-serif">so we back to step (2)</font>
<br>
<br><font size=2 face="sans-serif">Questions:</font>
<br><font size=2 face="sans-serif">-- Are there plans to better integrate
ocf:heartbeat:apache with systemd? Or are users expected to</font>
<br><font size=2 face="sans-serif">do the workaround as I did?</font>
<br><font size=2 face="sans-serif">-- Are there other integration issues
with systemd?</font>
<br><font size=2 face="sans-serif">-- I'd like to workaround the problem
in step (2) (stop does nothing). I think I can customize</font>
<br><font size=2 face="sans-serif">ExecStop in httpd.service but havne't
figured out how. Any advice how to do this?</font>
<br>
<br><font size=2 face="sans-serif">Thanks..</font>
<br><font size=2 face="sans-serif">Chuck</font>