Changes committed to git://pcp.io/markgw/pcp/pcp.git master
commit 2bf7acfe8c47ce0f5c257f3ba712b56cd44972b6
Author: Mark Goodwin <mgoodwin@xxxxxxxxxx>
Date: Tue Jul 28 17:20:53 2015 +1000
pmlogger - handle stale primary control and socket files
If pmlogger is SIGKILL'd then its exit handlers are not run and so the
control file and socket may not be removed. This is what happens when
a pcp-pmlogger container is killed by docker, but can also happen on
an abrupt reboot or if the pmlogger process is manually killed. When
pmlogger_check is next launched by cron, the new primary pmlogger process
thinks there is already a primary pmlogger process running (due to the
stale control file and socket, along with the 'primary' links to such).
This patch detects and removes stale control and socket files and their
primary links before creating new ones. If the pmlogger process is
actually still running then those files are not stale and the new
pmlogger process will instead exit with a configuration error (there
should only ever be one primary pmlogger).
Also change from hard links to symlinks for the primary control file
and the primary socket - this simplfies the code somewhat and it's
easier to check the destination of the 'primary' links.
modified: src/pmlogger/pmlogger_check.sh
modified: src/pmlogger/pmlogger_daily.sh
modified: src/pmlogger/src/ports.c
|