diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-01-26 21:45:45 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-01-26 21:45:45 +0000 |
| commit | a081d418937248c33387f94af17849ecb7566e26 (patch) | |
| tree | 99ed87769bb80ca449ad57dcbb1988f0a207a4b3 /lib/puppet/daemon.rb | |
| parent | c33d5e4a686ccb8482c73ae290455a987b4f32e7 (diff) | |
| download | puppet-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/puppet/daemon.rb')
| -rwxr-xr-x | lib/puppet/daemon.rb | 5 |
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 |
