mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
Bugfix : force lockfile removal if the cache is really too old
This commit is contained in:
parent
b6f9a54af7
commit
a2b3e009af
1 changed files with 14 additions and 2 deletions
|
@ -159,8 +159,20 @@ sub cache_is_too_old {
|
|||
} ## cache_is_too_old
|
||||
|
||||
sub du_not_running {
|
||||
return 0 if (-e $LOCKFILE);
|
||||
if (-e $LOCKFILE) {
|
||||
my ($time) = `cat $TIMEFILE`;
|
||||
chomp $time;
|
||||
if ( (time - $time) > ($ENV{interval}*60*60) ) {
|
||||
# The cache is really old (60xinterval) => Maybe the lockfile wasn't properly deleted.
|
||||
# Let's delete it.
|
||||
system("rm $LOCKFILE;");
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
sub munin_exit_done {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue