incorrect PID in initscript

Bug #1397898 reported by Jurjen Bokma on 2014-12-01
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
puppet (Ubuntu)
Medium
Unassigned

Bug Description

Abstract:
Puppet initscript doesn't record the correct PID. WIth this patch, it does.

Longer version:
When the Puppet agent daemon gets started, /etc/init.d/puppet records a PID in /var/run/puppet/${NAME}.pid, but it is the wrong one. Puppet may fork half a dozen times before settling on a PID. Start-stop-daemon has no way to keep track of such behaviour, and I know of no way to make Puppet write its own PID to a file. So I patched the script.
The patch isn't completely fool proof, but we ran it in production for months, and it's certainly better than no PID at all.

Is Ubuntu the place to offer such fixes? Or is it better to take them to Debian, or to PuppetLabs?

Jurjen Bokma (j-bokma-t) wrote :

Version data:
Ubuntu Trusty
Puppet 3.4.3-1 0

The attachment "Patch to make Puppet initscript find the PID of the daemon" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Robie Basak (racb) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.

> Is Ubuntu the place to offer such fixes?

It should go to Debian in the first instance, assuming that Debian is also affected - in Ubuntu, we try to keep the packaging in sync with Debian.

Changed in puppet (Ubuntu):
status: New → Triaged
status: Triaged → New
importance: Undecided → Medium
tags: added: needs-upstream-report

> It should go to Debian in the first instance, assuming that Debian is
Ok. Then it'll have to wait until I can confirm that Debian is affected
as well.

Thanks!

Jurjen Bokma <email address hidden> writes:

> ** Patch added: "Patch to make Puppet initscript find the PID of the daemon"
> https://bugs.launchpad.net/bugs/1397898/+attachment/4271933/+files/puppet-init.patch

That's a delightfully evil hack. Will using an upstart job work instead,
or do you need to keep track of the PID there, as well (something for
post-start, then)?

--
Stig Sandbeck Mathisen

Matthaus Owens (matthaus-m) wrote :

The puppet agent writes its own pidfile, to $vardir/run/agent.pid depending on what is in puppet.conf. If you are seeing problems with that, I would encourage you to open a bug upstream.

Matthaus Owens (matthaus-m) wrote :

Sorry, I should have said pidfile is written to $rundir/agent.pid. $rundir defaults to $vardir/run if not specified in puppet.conf.

Jurjen Bokma (j-bokma-t) wrote :

On 12/01/2014 10:42 PM, Stig Sandbeck Mathisen wrote:
> That's a delightfully evil hack. Will using an upstart job work instead,
> or do you need to keep track of the PID there, as well (something for
> post-start, then)?

Matthaus Owens of Puppet Labs responded that Puppet *does* write its own
PID. This is true for both the newest Puppet version from Puppet Labs
and the version currently in Ubuntu Trusty. So my patch is not needed
after all. It is enough to put the following in /etc/default/puppet
(which is source by the init script):

PIDFILE="/var/lib/puppet/run/agent.pid"

That is assuming that puppet.conf is the default. Alternatively,
according to
https://docs.puppetlabs.com/references/latest/configuration.html#pidfile
it is possible to set the location of the PIDfile to
/var/run/puppet/${NAME}.pid in /etc/puppet/puppet.conf.

On 12/02/2014 12:21 AM, Matthaus Owens wrote:
> Sorry, I should have said pidfile is written to $rundir/agent.pid.
> $rundir defaults to $vardir/run if not specified in puppet.conf.
>
Thank you! Now my config works, and this 'bug' report should never have
existed. :)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers