[ClusterLabs] ocf:heartbeart:apache and systemd
Ken Gaillot
kgaillot at redhat.com
Mon Mar 23 14:33:17 UTC 2015
On 03/20/2015 01:09 PM, Chuck Carmack wrote:
> 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.
Hi. Pacemaker and systemd are alternative means of managing services;
they shouldn't be used in combination. Any services managed by pacemaker
should be disabled in systemd, and only cluster commands (pcs etc.)
should be used to interact with them.
> 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
>
>
>
> _______________________________________________
> Users mailing list: Users at clusterlabs.org
> http://clusterlabs.org/mailman/listinfo/users
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org
>
More information about the Users
mailing list