Skip to content

Commit

Permalink
Idempotently replace existing symlink if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
zrhoffman committed Apr 29, 2024
1 parent fa31792 commit 8365645
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion traffic_monitor/build/traffic_monitor.spec
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ mkdir -p "${RPM_BUILD_ROOT}"/opt/traffic_monitor/backup
mkdir -p "${RPM_BUILD_ROOT}"/opt/traffic_monitor/static
mkdir -p "${RPM_BUILD_ROOT}"/opt/traffic_monitor/var/run
mkdir -p "${RPM_BUILD_ROOT}"/var/log/traffic_monitor

# TODO: The /opt/traffic_monitor/var/log symlink is deprecated and should be removed for ATC 9.0.0.
ln -sT /var/log/traffic_monitor "${RPM_BUILD_ROOT}"/opt/traffic_monitor/var/log
ln -sfT /var/log/traffic_monitor "${RPM_BUILD_ROOT}"/opt/traffic_monitor/var/log
mkdir -p "${RPM_BUILD_ROOT}"/etc/init.d
mkdir -p "${RPM_BUILD_ROOT}"/etc/logrotate.d

Expand Down
2 changes: 1 addition & 1 deletion traffic_router/build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
<installScriptlet>
<!-- TODO: The /opt/traffic_router/var/log symlink is deprecated and should be removed
for ATC 9.0.0. -->
<script>ln -sT /var/log/traffic_router %{buildroot}${deploy.dir}/var/log</script>
<script>ln -sfT /var/log/traffic_router %{buildroot}${deploy.dir}/var/log</script>
</installScriptlet>
<requires>
<require>java-11-openjdk-headless</require>
Expand Down
2 changes: 1 addition & 1 deletion traffic_router/tomcat-rpm/tomcat.spec
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ install -d -m 755 ${RPM_BUILD_ROOT}/%{tomcat_home}/
rmdir logs
mkdir -p "${RPM_BUILD_ROOT}"/var/log/tomcat
cp -R * ${RPM_BUILD_ROOT}/%{tomcat_home}/
ln -sT /var/log/tomcat "${RPM_BUILD_ROOT}"%{tomcat_home}/logs
ln -sfT /var/log/tomcat "${RPM_BUILD_ROOT}"%{tomcat_home}/logs

# Remove all webapps.
rm -rf ${RPM_BUILD_ROOT}/%{tomcat_home}/webapps/*
Expand Down
2 changes: 1 addition & 1 deletion traffic_stats/build/traffic_stats.spec
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ mkdir -p "${RPM_BUILD_ROOT}"/opt/traffic_stats/influxdb_tools
mkdir -p "${RPM_BUILD_ROOT}"/opt/traffic_stats/var/run
mkdir -p "${RPM_BUILD_ROOT}"/var/log/traffic_stats
# TODO: The /opt/traffic_stats/var/log symlink is deprecated and should be removed for ATC 9.0.0.
ln -sT /var/log/traffic_stats "${RPM_BUILD_ROOT}"/opt/traffic_stats/var/log
ln -sfT /var/log/traffic_stats "${RPM_BUILD_ROOT}"/opt/traffic_stats/var/log
mkdir -p "${RPM_BUILD_ROOT}"/etc/init.d
mkdir -p "${RPM_BUILD_ROOT}"/etc/logrotate.d
mkdir -p "${RPM_BUILD_ROOT}"/var/lib/grafana/plugins/trafficcontrol-scenes-app
Expand Down

0 comments on commit 8365645

Please sign in to comment.