summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-16 23:25:24 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-16 23:25:24 +0000
commit964c805d220b0bcf0afb03b6e1a654d2d2705ffa (patch)
treefc3e3f68c3c54972538255d10725b4ff96bd18ca /lib
parent2418e4a5dc8a750ae488021b8d7e7d7b2b06de1f (diff)
downloadpuppet-964c805d220b0bcf0afb03b6e1a654d2d2705ffa.tar.gz
puppet-964c805d220b0bcf0afb03b6e1a654d2d2705ffa.tar.xz
puppet-964c805d220b0bcf0afb03b6e1a654d2d2705ffa.zip
Trying to fix problem of locks lying around
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2204 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/network/client/master.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/puppet/network/client/master.rb b/lib/puppet/network/client/master.rb
index 9f07f48ef..066b97849 100644
--- a/lib/puppet/network/client/master.rb
+++ b/lib/puppet/network/client/master.rb
@@ -341,6 +341,7 @@ class Puppet::Network::Client::MasterClient < Puppet::Network::Client
def run(tags = nil, ignoreschedules = false)
lockfile = Puppet::Util::Pidlock.new(Puppet[:puppetdlockfile])
+ locked = false
Puppet::Util.sync(:puppetrun).synchronize(Sync::EX) do
if !lockfile.lock
Puppet.notice "Lock file %s exists; skipping configuration run" %
@@ -370,6 +371,9 @@ class Puppet::Network::Client::MasterClient < Puppet::Network::Client
Process.kill(:HUP, $$)
end
end
+ ensure
+ # Just make sure we remove the lock file if we set it.
+ lockfile.unlock if locked and lockfile.lock
end
def running?