[ClusterLabs] Antw: Re: Q: Recommened directory for RA auxillary files?

Ulrich Windl Ulrich.Windl at rz.uni-regensburg.de
Wed Sep 4 06:15:04 EDT 2019


>>> Jehan-Guillaume de Rorthais <jgdr at dalibo.com> schrieb am 04.09.2019 um
10:07 in
Nachricht <20190904100736.14c93f9e at firost>:
> On Tue, 03 Sep 2019 09:35:39 ‑0500
> Ken Gaillot <kgaillot at redhat.com> wrote:
> 
>> On Mon, 2019‑09‑02 at 15:23 +0200, Ulrich Windl wrote:
>> > Hi!
>> > 
>> > Are there any recommendations where to place (fixed content) files an
>> > RA uses?
>> > Usually my RAs use a separate XML file for the metadata, just to
>> > allow editing it in XML mode automatically.
>> > Traditionally I put the file in the same directory as the RA itself
>> > (like "cat $0.xml" for meta‑data).
>> > Are there any expectations that every file in the RA directory is an
>> > RA?
>> > (Currently I'm extending an RA, and I'd like to provide some
>> > additional user‑modifiable template file, and I wonder which path to
>> > use)
>> > 
>> > Regards,
>> > Ulrich  
>> 
>> I believe most (maybe even all modern?) deployments have both lib and
>> resource.d under /usr/lib/ocf. If you have a custom provider for the RA
>> under resource.d, it would make sense to use the same pattern under
>> lib.
> 
> Shouldn't it be $OCF_FUNCTIONS_DIR? Could this be generalized to RA for 
> their
> own lib or permanent dependencies files?

It all depends (a bit):
I'm adding logrotate support for my RA: As there will be multiple instances,
each using different log files, the RA creates a logrotate config file that
matches the configured instance upon "start" and removes it upon "stop". As I
did not want to use a built-in logrotate template, I put it in an external
file, letting the user customize it (a bit). Like maximum file size, frequency
of rotation, etc.

The current template looks like this:
# {__NOTE__}
{__LOGDIR__}/*.log {
        rotate 2
        nocreate
        size 1M
        #weekly
        #olddir {__LOGDIR__}/old
        missingok
        postrotate
                kill -HUP $(cat '{__PIDFILE__}')
        endscript
        delaycompress
        #nocompress
}

And I wondered where to put such files.  Currently I'm using
"/etc/ocf/<vendor>/<RA>/logrotate.in" which gives me kind of clean namespace.

Regards,
Ulrich

> _______________________________________________
> Manage your subscription:
> https://lists.clusterlabs.org/mailman/listinfo/users 
> 
> ClusterLabs home: https://www.clusterlabs.org/ 





More information about the Users mailing list