Logwatch Configuration Override File
Michael Newman
mgnewman at mac.com
Mon Dec 16 22:57:11 UTC 2024
Mike
Thank you for taking the time to write such a detailed explanation. Unfortunately, dunce that I am, I didn’t understand most of it. I’m just a tool user and have little understanding of the code behind the tools that I use.
When I see something like this:
reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/scripts/logwatch.pl
My head spins.
Am I supposed to actually do all that stuff that I see when I run port cat logwatch?
Sorry for my ignorance.
Mike
> On Dec 16, 2024, at 19:00, macports-users-request at lists.macports.org wrote:
>
> Date: Sun, 15 Dec 2024 19:04:21 -0800
> From: Mike Cappella <mike at cappella.us <mailto:mike at cappella.us>>
> To: macports-users at lists.macports.org <mailto:macports-users at lists.macports.org>
> Subject: Re: Logwatch Configuration Override File
> Message-ID: <77684C0A-5871-4FE0-8C8A-3A0E0A24A0DE at cappella.us <mailto:77684C0A-5871-4FE0-8C8A-3A0E0A24A0DE at cappella.us>>
> Content-Type: text/plain; charset="utf-8"
>
>
>
>> On Dec 15, 2024, at 5:48?PM, Michael Newman via macports-users <macports-users at lists.macports.org <mailto:macports-users at lists.macports.org>> wrote:
>>
>> I've been running Logwatch on a Raspberry Pi for some time and learned a lot from it. I decided to install on a Mac (Intel iMac running Sequoia) via MacPorts.
>>
>> The Logwatch configuration file:
>>
>> /opt/local/share/logwatch/default.conf/logwatch.conf
>>
>> says to override default variables by putting them in the following file:
>>
>> /etc/logwatch/conf/logwatch.conf
>>
>> However, that directory does not exist. So, I'm lost. Do I need to create that directory or does the override file go somewhere else?
>>
>
>
> MacPorts doesn't pollute the macOS root, and re-roots everything (it can) under /opt/local (by default).
>
> The port file has instructions to patch the downloaded, extracted archive, changing the default destination root. You can see the final result in the logwatch.pl script. You're trying to discover where some logwatch.conf file is located, so grep'ing for that yields:
>
> &ReadConfigFile ("$BaseDir/default.conf/logwatch.conf", "");
> &ReadConfigFile ("$BaseDir/dist.conf/logwatch.conf", "");
> &ReadConfigFile ("$ConfigDir/conf/logwatch.conf", "");
>
> And searching for BaseDir and ConfigDir reveal the answer:
>
> my $BaseDir = "/opt/local/share/logwatch";
> my $ConfigDir = "/opt/local/etc/logwatch";
>
> Later you see that it reads from the following config files:
>
> &ReadConfigFile ("$BaseDir/default.conf/logwatch.conf", "");
> &ReadConfigFile ("$BaseDir/dist.conf/logwatch.conf", "");
> &ReadConfigFile ("$ConfigDir/conf/logwatch.conf", "");
> &ReadConfigFile ("$ConfigDir/conf/override.conf", "logwatch");
>
> The command "port cat" will show the port file:
>
> $ port cat logwatch
>
> And you can see the see the instructions used to patch just before installaation.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20241217/b01bbf22/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1370 bytes
Desc: not available
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20241217/b01bbf22/attachment.bin>
More information about the macports-users
mailing list