pcp
[Top] [All Lists]

pcp updates: detect stale primary pmlogger control socket hard links

To: pcp <pcp@xxxxxxxxxxx>
Subject: pcp updates: detect stale primary pmlogger control socket hard links
From: Mark Goodwin <mgoodwin@xxxxxxxxxx>
Date: Fri, 10 Jul 2015 17:36:44 +1000
Delivered-to: pcp@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0
Changes committed to git:/pcp.io/markgw/pcp/pcp.git master

I've manually tested this but need to add some QA. It solves a big
problem with the pcp-pmlogger container. I'd appreciate some review
if anyone has time. Thanks.


commit fd9c4819a699064c529f46f7ff9ebfdec51510f4
Author: Mark Goodwin <mgoodwin@xxxxxxxxxx>
Date:   Fri Jul 10 17:23:30 2015 +1000

    pmlogger: detect stale /var/run/pcp/pmlogger.primary.socket hard links

    pmlogger.primary.socket is a hard link to the pmlogger control socket,
    which has the PID of the running primary logger in it's filename.
    pmlogger refuses to start if the hard link exists, even if that process
    is no longer running.

    This patch finds the hard link and removes it if the process is no longer
    running (i.e. stale), so the primary pmlogger can still start and create
    a new link. This was particularly problematic in the pcp-pmlogger container,
    where such stale links abound due to the extreme prejudice that docker
    uses when killing containers. If the hardlink references an actual running
    primary pmlogger process, then the link is not removed and the expected
    behaviour prevails. Additional QA tests for this are pending.

        modified: src/pmlogger/src/ports.c

<Prev in Thread] Current Thread [Next in Thread>
  • pcp updates: detect stale primary pmlogger control socket hard links, Mark Goodwin <=