08 January 2025

system-repository SMF access_log cleanup

The system-repository SMF delivers IPS packages to zones.

This SMF produces an access_log file which is not rotated
by default. If you run many zones this logfile grows
to multiple 100 MB. On a customer system with more
than 20 zones this file was over 3 GB in size.

This is a sample on one of our test systems

# ls -lh /var/log/pkg/sysrepo/access_log
-rw-r--r--   1 pkg5srv  bin         148M Jan  8 10:52 /var/log/pkg/sysrepo/access_log

You can manually rotate and compress this logfile using
the following command

# time logadm -c -z 0 /var/log/pkg/sysrepo/access_log

real    0m4.989s
user    0m4.164s
sys     0m0.815s

# ls -lh /var/log/pkg/sysrepo/access_log*
-rw-r--r--   1 pkg5srv  bin            0 Jan  8 10:54 /var/log/pkg/sysrepo/access_log
-rw-r--r--   1 pkg5srv  bin        26.7M Jan  8 10:52 /var/log/pkg/sysrepo/access_log.0.gz