Re: editing log files at post

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At the list of adding more trash to the fire..

Jason's comment below, I think is excellent -- that while sed-i will edit the file effectively, adding the snippet into the .d tree should accomplish the same thing. With an added bonus:

That second option allows the .conf file to remain unchanged, which has value in updates where the package being replaced has a %config(noreplace) and a bug fix which *addresses* the config. I run into people on both ends of the packaging process who haven't grokked that yet, so I thought to draw attention.

 - bish

Jason Kohles wrote:
Yes, order is important, as the options will only affect logfiles that
come after them, and since most of your logfiles are defined in
logrotate.d, the compress option comes too late.

To uncomment the existing compress option with sed, just use:

sed -i 's/^#compress/compress/' /etc/logrotate.conf

An easier (and more reliable) technique, however, is to add your option
overrides to a file that gets included before any of the other included
files, like so:

echo "compress" >> /etc/logrotate.d/000-local-overrides

That way you don't have to worry about figuring out whether the
commented out option is in the config file or what to do if someone has
added a space after the comment character.

_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/kickstart-list


[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux