blob: 0c3e7bb9160863c8bc47122f0150effafd1d110a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
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;
}
#
|