Permalink
Browse files

use environment var for rrdcached

To use the rrdcached daemon, the --debug command line should be used.
But as it is quite error prone, we switched to the environment var.
  • Loading branch information...
1 parent 11f6a34 commit fb041130dfde7b17d918ed2c8b15b60cae16279d @steveschnepp steveschnepp committed Jul 17, 2012
Showing with 7 additions and 5 deletions.
  1. +4 −3 master/lib/Munin/Master/GraphOld.pm
  2. +3 −2 master/lib/Munin/Master/UpdateWorker.pm
@@ -161,7 +161,7 @@ my $only_fqn = '';
my $watermark = "Munin " . $Munin::Common::Defaults::MUNIN_VERSION;
-# RRD param for --daemon
+# RRD param for RRDCACHED_ADDRESS
my @rrdcached_params;
my $running = 0;
@@ -308,8 +308,9 @@ sub graph_startup {
if ($config->{"rrdcached_socket"}) {
if ($RRDs::VERSION >= 1.3){
- push @rrdcached_params, "--daemon";
- push @rrdcached_params, $config->{"rrdcached_socket"};
+ # Using the RRDCACHED_ADDRESS environnement variable, as
+ # it is way less intrusive than the command line args.
+ $ENV{RRDCACHED_ADDRESS} = $config->{"rrdcached_socket"};
} else {
ERROR "[ERROR] RRDCached feature ignored: RRD version must be at least 1.3. Version found: " . $RRDs::VERSION;
}
@@ -857,8 +857,9 @@ sub _update_rrd_file {
} elsif($RRDs::VERSION < 1.3){
WARN "[WARN] RRDCached feature ignored: perl RRDs lib version must be at least 1.3. Version found: " . $RRDs::VERSION;
} else {
- push @update_rrd_data, "--daemon";
- push @update_rrd_data, $config->{"rrdcached_socket"};
+ # Using the RRDCACHED_ADDRESS environnement variable, as
+ # it is way less intrusive than the command line args.
+ $ENV{RRDCACHED_ADDRESS} = $config->{"rrdcached_socket"};
}
}

0 comments on commit fb04113

Please sign in to comment.