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
|