This is an automated email from the ASF dual-hosted git repository. ocket8888 pushed a commit to branch 5.1.x in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
commit f22b5d337449e9cc3b57c8e89383ab8f69c27a5d Author: Joe Pappano <[email protected]> AuthorDate: Thu Mar 18 17:48:02 2021 -0400 Fix ORT to reload traffic server when lua scripts are added or changed. (#5574) * Updated process_reload_restarts to include .lua files. * line 1337 removed exclusion for .lua files. so remap.config will be touched if lua files are changed. * Added LUA fix to change log (cherry picked from commit a289d9ce008df420b41f4b3ac488e094860b10f0) --- CHANGELOG.md | 1 + traffic_ops_ort/traffic_ops_ort.pl | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0685770..579de5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - [#5192](https://github.com/apache/trafficcontrol/issues/5192) - Fixed TO log warnings when generating snapshots for topology-based delivery services. - Fixed Invalid TS logrotate configuration permissions causing TS logs to be ignored by logrotate. - [#5604](https://github.com/apache/trafficcontrol/issues/5604) - traffic_monitor.log is no longer truncated when restarting Traffic Monitor +- [#1624](https://github.com/apache/trafficcontrol/issues/1624) - Fixed ORT to reload Traffic Server if LUA scripts are added or changed. ## [5.1.0] - 2021-02-21 ### Added diff --git a/traffic_ops_ort/traffic_ops_ort.pl b/traffic_ops_ort/traffic_ops_ort.pl index 5677297..dcfd41e 100755 --- a/traffic_ops_ort/traffic_ops_ort.pl +++ b/traffic_ops_ort/traffic_ops_ort.pl @@ -1318,7 +1318,7 @@ sub check_plugins { ( my @parts ) = split( /\//, $plugin_config_file ); $plugin_config_file = $parts[$#parts]; $plugin_config_file =~ s/\s+//g; - if ( !exists($cfg_file_tracker->{$plugin_config_file}->{'remap_plugin_config_file'} ) && $plugin_config_file !~ /.lua$/ ) { + if ( !exists($cfg_file_tracker->{$plugin_config_file}->{'remap_plugin_config_file'} )) { $cfg_file_tracker->{$plugin_config_file}->{'remap_plugin_config_file'} = 1; } } @@ -1437,6 +1437,10 @@ sub process_reload_restarts { ( $log_level >> $DEBUG ) && print "DEBUG New/changed header rewrite rule, installed in: $cfg_file. Later I will attempt to touch remap.config.\n"; $traffic_ctl_needed++; } + elsif ( $cfg_file =~ m/(.*)\.lua/ ) { + ( $log_level >> $DEBUG ) && print "DEBUG New/changed lua script, installed in: $cfg_file. touch remap.config, and traffic_ctl config reload needed.\n"; + $traffic_ctl_needed++; + } elsif ( $cfg_file eq "plugin.config" || $cfg_file eq "50-ats.rules" ) { ( $log_level >> $DEBUG ) && print "DEBUG $cfg_file changed, trafficserver restart needed.\n"; $trafficserver_restart_needed++;
