Added puppet deadlock file removal if it's too old into puppet-check.
This commit is contained in:
parent
301a47af23
commit
dafb6c3f43
1 changed files with 8 additions and 0 deletions
|
@ -33,6 +33,14 @@ begin
|
||||||
Process.kill("HUP", pid)
|
Process.kill("HUP", pid)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# check if deadlock file is too old
|
||||||
|
dlock = Puppet.settings.value("puppetdlockfile")
|
||||||
|
if File.exists?(dlock) and Time.new - File.new(dlock).mtime > 43200
|
||||||
|
print "puppetd deadlock file is over 12 hours old, removing it and sending HUP to daemon\n"
|
||||||
|
File.unlink(dlock)
|
||||||
|
Process.kill("HUP", pid)
|
||||||
|
end
|
||||||
|
|
||||||
exit
|
exit
|
||||||
rescue Errno::ESRCH
|
rescue Errno::ESRCH
|
||||||
nil
|
nil
|
||||||
|
|
Loading…
Add table
Reference in a new issue