apache / trafficcontrol

Apache Traffic Control is an Open Source implementation of a Content Delivery Network
https://trafficcontrol.apache.org/
Apache License 2.0
1.02k stars 339 forks source link

Move existing logs in `/opt/<component>/var/log` to `/var/log/<component>` pre-upgrade #8001

Closed zrhoffman closed 2 months ago

zrhoffman commented 2 months ago

The symlinks created in #7999 work, but only for fresh installs, not upgrades. #8001 fixes that by

Which Traffic Control components are affected by this PR?

What is the best way to verify this PR?

  1. Build the RPMs

    ./pkg -v traffic_monitor_build traffic_stats_build traffic_router_build
  2. Verify that files that exist in the old log directories pre-install are moved to the new log directories

    <<'SHELL_COMMANDS' docker run --rm -i -v $(pwd)/dist:/dist rockylinux:8 bash
    set -o errexit
    mkdir -p /opt/traffic_{monitor,stats,router}/var/log
    touch /opt/traffic_{monitor,stats,router}/var/log/my-logfile.log
    rpm -Uvh --nodeps dist/traffic_monitor-8.1.0-12410.cff72c19.el8.x86_64.rpm dist/traffic_router-8.1.0-12410.cff72c19.el8.noarch.rpm dist/traffic_stats-8.1.0-12410.cff72c19.el8.x86_64.rpm
    ls -1 /var/log/traffic_{monitor,stats,router}/my-logfile.log
    SHELL_COMMANDS

    Expected output:

    /var/log/traffic_monitor/my-logfile.log
    /var/log/traffic_router/my-logfile.log
    /var/log/traffic_stats/my-logfile.log

PR submission checklist