summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-01-26 21:45:45 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-01-26 21:45:45 +0000
commita081d418937248c33387f94af17849ecb7566e26 (patch)
tree99ed87769bb80ca449ad57dcbb1988f0a207a4b3 /lib
parentc33d5e4a686ccb8482c73ae290455a987b4f32e7 (diff)
downloadpuppet-a081d418937248c33387f94af17849ecb7566e26.tar.gz
puppet-a081d418937248c33387f94af17849ecb7566e26.tar.xz
puppet-a081d418937248c33387f94af17849ecb7566e26.zip
Fixing #418. The problem was that multiple objects might include Daemon, which means that Daemon#shutdown can be called multiple times.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2094 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rwxr-xr-xlib/puppet/daemon.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/puppet/daemon.rb b/lib/puppet/daemon.rb
index 661c25947..bd02a9dc3 100755
--- a/lib/puppet/daemon.rb
+++ b/lib/puppet/daemon.rb
@@ -239,7 +239,10 @@ module Puppet
# Remove the pid file
def rmpidfile
threadlock(:pidfile) do
- Puppet::Util::Pidlock.new(pidfile).unlock or Puppet.err "Could not remove PID file %s" % [pidfile]
+ locker = Puppet::Util::Pidlock.new(pidfile)
+ if locker.locked?
+ locker.unlock or Puppet.err "Could not remove PID file %s" % [pidfile]
+ end
end
end