Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-9247

Puppet pidlock checks only look for PID if it is running, not process name

    Details

    • CS Priority:
      Reviewed
    • Release Notes:
      Not Needed
    • QA Risk Assessment:
      Needs Assessment

      Description

      Puppet Version: 6.0.2 (or any)
      Puppet Server Version:  2018.1
      OS Name/Version: Windows (linux most likely as well)

      When puppet runs it created the pidlock file with the pid of puppet.  If puppet stops/crashes while running the lock file remains.  Puppet reads the file, checks for pid as integer, and sees if that pid is running (system.kill(0) to see if alive). If ANY PID responds, it locks, even if the PID is not a puppet PID.

      Desired Behavior: Puppet should check PID to see if it is running and its puppet, not just running.

      Actual Behavior: if any process has that pid, puppet locks.

      Steps to replicate (tested on windows 2016 with Puppet 6.0.2)

      1 - start puppet run with 'puppet agent -t'

      2 - while running stop the puppet/puppet-pxp agent services

      3 - open pidloclk file, there should be a PID there

      4 - change PID lock file contents to any other currently running PID

      5 - start puppet / run 'puppet agent -t'

       

      Affected Code: https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/pidlock.rb#L55

      This is the logic check that only determines if a pid is active, not who owns it.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                scott.garman Scott Garman
                Reporter:
                mike.smith Mike Smith
              • Votes:
                0 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support