dyindude / ubuntu-zfs

BSD 2-Clause "Simplified" License
8 stars 4 forks source link

ensure compression is disabled for all logrotate jobs #24

Closed dyindude closed 6 years ago

dyindude commented 6 years ago

From https://github.com/zfsonlinux/zfs/wiki/Ubuntu-18.04-Root-on-ZFS

8.3 Optional: Disable log compression:

As /var/log is already compressed by ZFS, logrotate’s compression is going to burn CPU and disk I/O for (in most cases) very little gain. Also, if you are making snapshots of /var/log, logrotate’s compression will actually waste space, as the uncompressed data will live on in the snapshot. You can edit the files in /etc/logrotate.d by hand to comment out compress, or use this loop (copy-and-paste highly recommended):

# for file in /etc/logrotate.d/* ; do
    if grep -Eq "(^|[^#y])compress" "$file" ; then
        sed -i -r "s/(^|[^#y])(compress)/\1#\2/" "$file"
    fi
done

should be easy enough to write a utility/maintenance script with ansible for handling this and enforcing it for new packages that get installed

dyindude commented 6 years ago

for now, my thought is that this would be something best left up to config management, not provisioning, leaving issue open for now