pcp
[Top] [All Lists]

pcp updates: v2 patch for review - pmlogger - handle stale primary contr

To: pcp <pcp@xxxxxxxxxxx>
Subject: pcp updates: v2 patch for review - pmlogger - handle stale primary control and socket files
From: Mark Goodwin <mgoodwin@xxxxxxxxxx>
Date: Tue, 28 Jul 2015 17:37:27 +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

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

<Prev in Thread] Current Thread [Next in Thread>
  • pcp updates: v2 patch for review - pmlogger - handle stale primary control and socket files, Mark Goodwin <=