/var/log/wtmp size increases in VMware Cloud Director Appliance
search cancel

/var/log/wtmp size increases in VMware Cloud Director Appliance

book

Article ID: 428309

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

The /var/log/wtmp file in the VMware Cloud Director Appliance is not being rotated automatically.

Environment

VMware Cloud Director 10.4.x

VMware Cloud Director 10.5.x

VMware Cloud Director 10.6.x

Cause

Starting from logrotate 3.14.x, the log rotation configuration for /var/log/wtmp and /var/log/btmp was moved from /etc/logrotate.conf to individual files under the /etc/logrotate.d/ directory.
In th Photon OS packages used by the appliance, the default configuration files /etc/logrotate.d/wtmp and /etc/logrotate.d/btmp are missing.

Resolution

To resolve this issue, manually create the missing logrotate configuration files.

  1. SSH to the VMware Cloud Director cell as root.
  2. Execute the following command to create the /etc/logrotate.d/wtmp configuration file:


    tee /etc/logrotate.d/wtmp <<'EOF'
    # no packages own wtmp -- we'll rotate it here
    /var/log/wtmp {
        missingok
        monthly
        create 0664 root utmp
        minsize 1M
        rotate 1
    }
    EOF


  3. Execute the following command to create the /etc/logrotate.d/btmp configuration file:


    tee /etc/logrotate.d/btmp <<'EOF'
    # no packages own btmp -- we'll rotate it here
    /var/log/btmp {
        missingok
        monthly
        create 0600 root utmp
        rotate 1
    }
    EOF


  4. Set the correct permissions for the new files:


    chmod 644 /etc/logrotate.d/wtmp
    chmod 644 /etc/logrotate.d/btmp