On 07/22/2016 06:59 AM, Ken McDonell wrote:
commit e607bbc64a18e7ad8c50503341dd3119231804e7
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Fri Jul 22 06:48:38 2016 +1000
src/pmlogger/src/ports.c: fix broken logic for primary control file
This was the root cause of the qa/1108 failures.
The logic that checked for and stopped more than one primary pmlogger
from running was broken. Specifically using stat() instead of
lstat() to check for a symbolic link will always fail, which drove
us down the "old-style hardlink" path and unconditionally removed
$PCP_TMP_DIR/pmlogger/primary before the existance check that was
intended to stop multiple primary loggers from running.
This error seems to have been introduced in commit 7148bf11 (almost
12 months ago) ... sigh.
/*
* make sure control port files are removed when pmlogger terminates
@@ -539,15 +606,15 @@ init_ports(void)
* normally an upgrade will restart pmlogger and atexit(cleanup) will
* have been run, which will remove legacy hardlinks.
*/
- if (stat(linkfile, &sbuf) == 0 && !S_ISLNK(sbuf.st_mode)) {
+ if (lstat(linkfile, &sbuf) == 0 && !S_ISLNK(sbuf.st_mode)) {
wow, such a stupid mistake of mine - 12 months ago. Thanks for finding it Ken,
I owe you a beer or three next time we catch up
Cheers
-- Mark
|