summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bays <robert@vyatta.com>2010-07-14 14:52:46 -0700
committerRobert Bays <robert@vyatta.com>2010-07-14 14:52:46 -0700
commit0984d02b0beb7a453b4ab9a92335d404908073e0 (patch)
tree131fd5a7351fd5854d484855341c6e6bcb661936
parentf16a11dc823d3eae8b6825b296131da03e2259c4 (diff)
downloadvyatta-cfg-quagga-0984d02b0beb7a453b4ab9a92335d404908073e0.tar.gz
vyatta-cfg-quagga-0984d02b0beb7a453b4ab9a92335d404908073e0.zip
fix for bug 5811
-rw-r--r--lib/Vyatta/Quagga/Config.pm22
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/Vyatta/Quagga/Config.pm b/lib/Vyatta/Quagga/Config.pm
index 4f3a9d36..21aadb2a 100644
--- a/lib/Vyatta/Quagga/Config.pm
+++ b/lib/Vyatta/Quagga/Config.pm
@@ -219,7 +219,27 @@ sub _sendQuaggaCommand {
push (@arg_array, "$section");
}
- system(@arg_array) == 0 or die "_sendQuaggaCommand: @arg_array failed: $?";
+ system(@arg_array) == 0 or _logger(\@arg_array, 1);
+
+ return 1;
+}
+
+# log error message to syslog, optionally die
+# input: $1 - reference to error message array
+# $2 - die boolean
+sub _logger {
+ my $error_array = shift;
+ my $die = shift;
+ my @logger_cmd = ("/usr/bin/logger");
+
+ push (@logger_cmd, "-i");
+ push (@logger_cmd, "-t vyatta-cfg-quagga");
+ if ($_DEBUG) { push (@logger_cmd, "-s"); }
+ push (@logger_cmd, "@{$error_array} failed: $?");
+
+ system(@logger_cmd) == 0 or die "unable to log system error message.";
+
+ if ($die) { die "Error configuring routing subsystem. See log for more detailed information\n"; }
return 1;
}