Issue #12188 has been updated by Brice Figureau.

Does the following (proudly untested) works:

<pre>
diff --git a/lib/puppet/daemon.rb b/lib/puppet/daemon.rb
index 22630ff..a06780a 100755
--- a/lib/puppet/daemon.rb
+++ b/lib/puppet/daemon.rb
@@ -75,7 +75,7 @@ class Puppet::Daemon
   def remove_pidfile
     Puppet::Util.synchronize_on(Puppet[:name],Sync::EX) do
       locker = Puppet::Util::Pidlock.new(pidfile)
-      locker.unlock or Puppet.err "Could not remove PID file #{pidfile}" if 
locker.locked?
+      locker.unlock or Puppet.err "Could not remove PID file #{pidfile}" if 
locker.locked? and locker.mine?
     end
   end
 
</pre>

It's possible this patch is the root cause of the issue: 
b434e3b9c31de63365e1a0f53d152be7e6e988ec which was merged as part of #3757.

----------------------------------------
Bug #12188: agent when run --no-daemonize tries to remove the pid of a running 
daemon
https://projects.puppetlabs.com/issues/12188

Author: R.I. Pienaar
Status: Unreviewed
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


The fix in #5246 got the agent remove its pid after running.  It's 
unfortunately too big a hammer as when the agent is also running daemonized the 
pid removal will fail and log an err level message.

Before removing the pid file we should figure out if the pid file belongs to 
the current process and only then remove it.

This is confirmed on 2.7.10 but might also be the case in 2.6 master


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to