I'm trying to decide how best to manage certain entries in Solaris
/etc/logadm.conf files. Initially, I'm just trying to ensure that
/var/adm/wtmpx is being rotated correctly. However, there are a couple
of catches in trying to manage this file.

1. The file is generally maintained through the logadm(1M) command, so
that would imply that commands promises would be better than files
promises. However...

2. Whenever logadm rotates a file, it adds an option to the file's entry
to record the last rotation time for the file. For example, a new wtmpx
entry like

   /var/adm/wtmpx -C 3 -c -p 1m

might become

   /var/adm/wtmpx -C 3 -P 'Sat May  8 03:10:00 2010' -c -p 1m 

The location of the "-P 'timestamp'" option does not appear
deterministic. This complicates trying to determine whether the wtmpx
entry is correct. For example, say I have a bundle to which I pass a
filename a list of options:

   "wtmpx" usebundle => _rotate_solaris_log("/var/adm/wtmpx", "-C 3 -c
-p 1m");

In the bundle, I see if there is already an entry that begins with
/var/adm/wtmpx. If not, I add it. If so, I leave it alone. However,
if/when I want to change the rotation parameters (say, changing "-p 1m"
to "-p 1w"), an exact match against the parameter string won't work
because of the added -P flag, and I'd like to avoid changing the line
EVERY time Cfengine runs.

Any thoughts that I might not have considered yet on how to approach
managing this file? Note that the parameters for wtmpx, for example, may
vary based on classes.

Thanks,
Justin

-- 
Justin C. Lloyd 
Unix Infrastructure Engineer 
DigitalGlobe, An Imaging and Information Company



This electronic communication and any attachments may contain confidential and 
proprietary 
information of DigitalGlobe, Inc. If you are not the intended recipient, or an 
agent or employee 
responsible for delivering this communication to the intended recipient, or if 
you have received 
this communication in error, please do not print, copy, retransmit, disseminate 
or 
otherwise use the information. Please indicate to the sender that you have 
received this 
communication in error, and delete the copy you received. DigitalGlobe reserves 
the 
right to monitor any electronic communication sent or received by its 
employees, agents 
or representatives.

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to