summaryrefslogtreecommitdiffstats
path: root/lib/Smokeping.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Smokeping.pm')
-rw-r--r--lib/Smokeping.pm13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm
index 0c94b12..c53b3ed 100644
--- a/lib/Smokeping.pm
+++ b/lib/Smokeping.pm
@@ -1326,7 +1326,8 @@ sub get_detail ($$$$;$){
'--height',$cfg->{Presentation}{detail}{height},
'--width',$cfg->{Presentation}{detail}{width},
'--title',$desc.$from,
- '--rigid','--upper-limit', $max->{$s}{$start},
+ '--rigid',
+ '--upper-limit', $max->{$s}{$start},
@log,
'--lower-limit',(@log ? ($max->{$s}{$start} > 0.01) ? '0.001' : '0.0001' : '0'),
'--vertical-label',$ProbeUnit,
@@ -3721,7 +3722,8 @@ sub load_cfg ($;$) {
my $cfmod = (stat $cfgfile)[9] || die "ERROR: calling stat on $cfgfile: $!\n";
# when running under speedy this will prevent reloading on every run
# if cfgfile has been modified we will still run.
- if (not defined $cfg or not defined $probes or $cfg->{__last} < $cfmod ){
+ if (not defined $cfg or not defined $probes # or $cfg->{__last} < $cfmod
+ ){
$cfg = undef;
my $parser = get_parser;
$cfg = get_config $parser, $cfgfile;
@@ -3844,9 +3846,10 @@ POD
}
sub cgi ($) {
+ my $cfgfile = shift;
$cgimode = 'yes';
umask 022;
- load_cfg shift;
+ load_cfg $cfgfile;
my $q=new CGI;
initialize_cgilog();
if ($q->param(-name=>'slave')) { # a slave is calling in
@@ -3864,6 +3867,10 @@ sub cgi ($) {
}
display_webpage $cfg,$q;
}
+ if ((stat $cfgfile)[9] > $cfg->{__last}){
+ # we die if the cfgfile is newer than our in memory copy
+ kill -9, $$;
+ }
}