[Logwatch-Devel] patch for logwatch.pl to set $BaseDir (and $PerlVersion)

David Baldwin david.baldwin at anu.edu.au
Fri Sep 16 00:35:41 MST 2005


The following patch makes it easier to run the development version direct from a 
CVS tree or as the installed version. Note you have to use $RealBin since 
typically $Bin will be /usr/sbin for an installed version.

$ ls -l /usr/sbin/logwatch
lrwxrwxrwx    1 root     root           35 Jun 27 17:01 /usr/sbin/logwatch -> 
../../etc/log.d/scripts/logwatch.pl

Could also consider setting:
  my $PerlVersion = $^X;

OR

  use English;
  my $PerlVersion = $EXECUTABLE_NAME;

David.


--- scripts/logwatch.pl 14 Jun 2005 05:36:58 -0000      1.131
+++ scripts/logwatch.pl 16 Sep 2005 07:25:40 -0000
@@ -20,10 +20,12 @@
  #
  ########################################################

+use FindBin qw($RealBin);
  #To be FHS compliant distro packages might use this
  #my $BaseDir = "/usr/share/logwatch";
  #my $ConfigDir = "/etc/log.d/conf";
-my $BaseDir = "/etc/log.d";
+#my $BaseDir = "/etc/log.d";
+my $BaseDir = "$RealBin/..";
  my $ConfigDir = "$BaseDir/conf";
  my $PerlVersion = "/usr/bin/perl";


-- 
=====================================================================+
David Baldwin                   mailto:David.Baldwin at anu.edu.au      |
Supercomputer Facility          URL: http://www.anu.edu.au/~u8611156 |
II Services, Huxley Building    Ph:  {intl+61+2 | (02)} 6125 0321    |
Australian National University  FAX: {intl+61+2 | (02)} 6125 8199    |
Canberra ACT 0200, AUSTRALIA  *======================================+


More information about the Logwatch-Devel mailing list