This addresses Nathan's concern about upgrades following review of the
earlier commit.
I've tested an upgrade and it works as expected, provided the existing
pmlogger process is killed normally (as is the case during an upgrade).
In that case pmlogger's atexit(cleanup) handler gets run and the primary
control and socket links are correctly removed prior to the new version
of pmlogger getting started.
However, there is a corner case if the primary logger is killed with
a SIGKILL prior to the upgrade, in which case there are legacy *hard*
links that need to be removed by the new pmlogger process.
Also updated qa/808 to exercise this corner case.
Changes committed to git://pcp.io/markgw/pcp/pcp.git master
commit 7148bf11e779f93d930416c9ac50979ea253b82e
Author: Mark Goodwin <mgoodwin@xxxxxxxxxx>
Date: Sat Aug 1 17:20:52 2015 +1000
pmlogger - also handle stale legacy hard links for primary pmlogger run
files
On an upgrade from a previous version of PCP (that still used hard links for
the control and socket primary links), if pmlogger is killed with SIGKILL
prior to the upgrade, then there may be stale legacy hard links for the
primary control file and socket. If found, these need to be removed before
checking for stale symlinks - hard links are always stale here.
Also add an additional test for this in qa/808.
modified: qa/808
modified: qa/808.out
modified: src/pmlogger/src/ports.c
|