You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-admin/tenshi/files/tenshi-0.10-warn-logfile.patch

35 lines
1011 B

Submitted by: Heath Caldwell <hncaldwell@gentoo.org>
Date: 2008-12-17
Initial Package Version: 0.10
Upstream Status: No response
Description: Warns on log files that tenshi can't open and continues monitoring the ones that it can, instead of just exiting.
--- a/tenshi
+++ b/tenshi
@@ -141,10 +141,23 @@
die RED "[ERROR] $main{'csv'}{'path'}: not executable";
}
+ my @good_log_files;
foreach my $log (@log_files) {
- die RED "[ERROR] $log: no such file" if (! -f $log);
- die RED "[ERROR] $log: file not readable" if (! -r $log);
+ unless (-f $log) {
+ print STDERR RED "[WARNING] $log: no such file\n";
+ next;
+ }
+
+ unless (-r $log) {
+ print STDERR RED "[WARNING] $log: file not readable\n";
+ next;
+ }
+
+ push @good_log_files, $log;
}
+ @good_log_files > 0 || @fifo_files > 0
+ or die RED "[ERROR] no readable log files";
+ @log_files = @good_log_files;
}
#