diff -Nur --no-dereference e-smith-apache-2.6.0.old/createlinks e-smith-apache-2.6.0/createlinks --- e-smith-apache-2.6.0.old/createlinks 2022-02-18 22:15:22.484000000 -0500 +++ e-smith-apache-2.6.0/createlinks 2022-02-18 22:21:57.175000000 -0500 @@ -9,6 +9,7 @@ safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith"); event_link("systemd-reload", $event, "89"); event_link("systemd-default", $event, "88"); +templates2events("/etc/logrotate.d/httpd", $event); #-------------------------------------------------- # actions for console-save event @@ -168,17 +169,19 @@ $event = "ssl-update"; templates2events("/etc/httpd/conf/httpd.conf", $event); -safe_symlink("reload", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith"); +safe_symlink("reload", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith"); + +#-------------------------------------------------- +# actions for post-install event +#-------------------------------------------------- +$event = "post-install"; +templates2events("/etc/logrotate.d/httpd", $event); -# Set up generic logfile timestamp renaming/symlinking +#-------------------------------------------------- +# actions for post-upgrade event +#-------------------------------------------------- + +$event = "post-upgrade"; +templates2events("/etc/logrotate.d/httpd", $event); -foreach (qw( - /var/log/httpd/error_log - /var/log/httpd/access_log - )) -{ - safe_touch "root/etc/e-smith/events/logrotate/logfiles2timestamp/$_"; - safe_touch "root/etc/e-smith/events/post-install/logfiles2timestamp/$_"; - safe_touch "root/etc/e-smith/events/post-upgrade/logfiles2timestamp/$_"; -} diff -Nur --no-dereference e-smith-apache-2.6.0.old/root/etc/e-smith/templates/etc/logrotate.d/httpd/00notused e-smith-apache-2.6.0/root/etc/e-smith/templates/etc/logrotate.d/httpd/00notused --- e-smith-apache-2.6.0.old/root/etc/e-smith/templates/etc/logrotate.d/httpd/00notused 2008-10-07 11:53:34.000000000 -0400 +++ e-smith-apache-2.6.0/root/etc/e-smith/templates/etc/logrotate.d/httpd/00notused 1969-12-31 19:00:00.000000000 -0500 @@ -1,4 +0,0 @@ -# -# We do not use logrotate to rotate apache controlled logfiles, -# we reconfigure apache instead. No action required here. -# diff -Nur --no-dereference e-smith-apache-2.6.0.old/root/etc/e-smith/templates/etc/logrotate.d/httpd/10global e-smith-apache-2.6.0/root/etc/e-smith/templates/etc/logrotate.d/httpd/10global --- e-smith-apache-2.6.0.old/root/etc/e-smith/templates/etc/logrotate.d/httpd/10global 1969-12-31 19:00:00.000000000 -0500 +++ e-smith-apache-2.6.0/root/etc/e-smith/templates/etc/logrotate.d/httpd/10global 2022-02-18 22:49:31.044000000 -0500 @@ -0,0 +1,14 @@ +/var/log/httpd/*log \{ + create root root + missingok + notifempty + sharedscripts + rotate {${'httpd-e-smith'}{'KeepNumberLog'} || $rsyslog{'KeepNumber'} || 10 } + size {${'httpd-e-smith'}{'MaxSizeLog'} || $rsyslog{'MaxSize'} || "100M";} + maxage {${'httpd-e-smith'}{'PurgeLengthLog'} || $rsyslog{'PurgeLength'} || 95;} + { $OUT = "#default compress see logrotate.conf" ; $OUT = "compress " unless ( (${'httpd-e-smith'}{'CompressLog'} || "disabled") eq "disabled" );} + delaycompress + postrotate + /bin/systemctl restart httpd-*.service > /dev/null 2>/dev/null || true + endscript +\}