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

Puppet pidlock incorrectly clears lock when running under bundler

    XMLWordPrintable

Details

    • Night's Watch
    • PR - 2019-05-29, PR - 2019-06-12, PR - 2019-06-25
    • Bug Fix
    • Hide
      If a Puppet run is killed the lockfile remains containing the PID that was previously being used for the process. If another process starts and uses this PID, the Puppet agent will fail. Fix: puppet will check that the PID belongs to puppet in order to lock the PID correctly. This fix works for Puppet even if it runs as a gem.
      Show
      If a Puppet run is killed the lockfile remains containing the PID that was previously being used for the process. If another process starts and uses this PID, the Puppet agent will fail. Fix: puppet will check that the PID belongs to puppet in order to lock the PID correctly. This fix works for Puppet even if it runs as a gem.
    • Needs Assessment

    Description

      When running puppet in bundler, puppet will take ownership of its pidfile even if another puppet process is still running. It's because ps -p <pid> -o comm= returns the entire command line instead of just the process name:

      $ ps -p 33239 -o comm=
      /Users/josh/work/puppet/.bundle/ruby/2.5.0/bin/puppet agent --no-daemonize --runinterval 15s --certname wtf18 -v
      

      The behavior seems to be ruby or platform specific. On redhat with ruby 2.3:

      root@k1zm807wxji34df:~# ps -p 17196 -o comm=
      ruby2.3
      root@k1zm807wxji34df:~# ps -p 17196 -o args=
      ruby2.3 /root/puppet/.bundle/ruby/2.3.0/bin/puppet agent --no-daemonize -v
      

      When running puppet from a package, the process name is just puppet

      [root@dp4uykbg81px49u ~]# ps -p `cat /var/run/puppetlabs/agent.pid` -o comm=
      puppet
      

      This regression was introduced in PUP-9247.

      Attachments

        Issue Links

          Activity

            People

              oana.tanasoiu Oana Tanasoiu
              josh Josh Cooper
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support