summaryrefslogtreecommitdiffstats
path: root/lib/Smokeping.pm
diff options
context:
space:
mode:
authorTobi Oetiker <tobi@oetiker.ch>2007-12-01 12:31:33 +0100
committerTobi Oetiker <tobi@oetiker.ch>2007-12-01 12:31:33 +0100
commit1eeea07d34fec85eb09fbc5504b588f7ee9bfcd4 (patch)
treeefdca03a27a42360d923ab04a3c4507347f7a91c /lib/Smokeping.pm
parent610bab43a1ddd085a1c272c5cf6aaf4a85ed8fee (diff)
downloadsmokeping-1eeea07d34fec85eb09fbc5504b588f7ee9bfcd4.tar.gz
smokeping-1eeea07d34fec85eb09fbc5504b588f7ee9bfcd4.tar.xz
fix restart behaviour of slaves
Diffstat (limited to 'lib/Smokeping.pm')
-rw-r--r--lib/Smokeping.pm13
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm
index 1c66001..588c67d 100644
--- a/lib/Smokeping.pm
+++ b/lib/Smokeping.pm
@@ -3755,7 +3755,7 @@ sub main (;$) {
shared_secret => $secret,
slave_name => $opt{'slave-name'} || hostname(),
};
- # this should get us a config set from the server
+ # this should get us an initial config set from the server
my $new_conf = Smokeping::Slave::submit_results($slave_cfg,$cfg);
if ($new_conf){
$cfg=$new_conf;
@@ -3844,7 +3844,7 @@ RESTART:
$gothup = 1;
};
while (1) { # just wait for the signals
- sleep;
+ sleep; #sleep until we get a signal
next unless $gothup;
$reloading = 1;
$gothup = 0;
@@ -3963,13 +3963,8 @@ KID:
my %sortercache;
if ($opt{'master-url'}){
my $new_conf = Smokeping::Slave::submit_results $slave_cfg,$cfg,$myprobe,$probes;
- if ($new_conf){
- $cfg=$new_conf;
- $probes = undef;
- $probes = load_probes $cfg;
- $cfg->{__probes} = $probes;
- add_targets($cfg, $probes, $cfg->{Targets}, $cfg->{General}{datadir});
- goto RESTART;
+ if ($new_conf){
+ kill $$, SIGHUP;
}
} else {
update_rrds $cfg, $probes, $cfg->{Targets}, $cfg->{General}{datadir}, $myprobe, \%sortercache;