diff -Nur --no-dereference e-smith-base-5.8.1.old/createlinks e-smith-base-5.8.1/createlinks --- e-smith-base-5.8.1.old/createlinks 2022-04-16 23:39:45.153000000 -0400 +++ e-smith-base-5.8.1/createlinks 2022-04-16 23:46:57.368000000 -0400 @@ -307,8 +307,9 @@ templates2events("/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf", $event); event_link("systemd-journald", $event, "02"); event_link("fix-startup", $event, "05"); -event_link("rotate_logfiles", $event, "05"); event_link("init-accounts", $event, "05"); +event_link("logrotate-migrate", $event, "06"); +event_link("rotate_logfiles", $event, "07"); event_link("set-hostname", $event, "10"); event_link("rmmod-bonding", $event, "10"); event_link("conf-startup", $event, "10"); @@ -446,8 +447,8 @@ templates2events("/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf", $event); event_link("systemd-journald", $event, "02"); event_link("fix-startup", $event, "05"); -event_link("rotate_logfiles", $event, "05"); event_link("init-accounts", $event, "05"); +event_link("rotate_logfiles", $event, "07"); event_link("init-passwords", $event, "10"); event_link("conf-startup", $event, "10"); event_link("user-rsshd", $event, "16"); @@ -466,8 +467,9 @@ templates2events("/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf", $event); event_link("systemd-journald", $event, "02"); event_link("fix-startup", $event, "05"); -event_link("rotate_logfiles", $event, "05"); event_link("init-accounts", $event, "05"); +event_link("logrotate-migrate", $event, "06"); +event_link("rotate_logfiles", $event, "07"); event_link("conf-startup", $event, "10"); event_link("user-lock-passwd", $event, "15"); event_link("group-modify-unix", $event, "15"); @@ -583,7 +585,8 @@ $event = "logrotate"; -event_link("rotate_logfiles", $event, "05"); +event_link("logrotate-migrate", $event, "06"); +event_link("rotate_logfiles", $event, "07"); event_link("purge-old-logs", $event, "75"); safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/rsyslog"); diff -Nur --no-dereference e-smith-base-5.8.1.old/root/etc/e-smith/events/actions/logrotate-migrate e-smith-base-5.8.1/root/etc/e-smith/events/actions/logrotate-migrate --- e-smith-base-5.8.1.old/root/etc/e-smith/events/actions/logrotate-migrate 1969-12-31 19:00:00.000000000 -0500 +++ e-smith-base-5.8.1/root/etc/e-smith/events/actions/logrotate-migrate 2022-04-16 23:59:07.124000000 -0400 @@ -0,0 +1,51 @@ +#!/bin/bash +# this script is to migrate old symlink log to regular file in order +# to be handled by logrotate + +#known files that could be symlinks +FILES="/var/log/cron +/var/log/maillog +/var/log/messages +/var/log/secure +/var/log/spooler +/var/log/boot.log +/var/log/httpd/admin_access_log +/var/log/httpd/admin_error_log +/var/log/httpd/access_log +/var/log/httpd/error_log +/var/log/httpd/fpbx_error_log +/var/log/httpd/fpbx_access_log +/var/log/httpd/bkpc_access_log +/var/log/httpd/bkpc_error_log +/var/log/httpd/issoqlog_access_log +/var/log/httpd/isoqlog_access_log +/var/log/httpd/isoqlog_error_log +/var/log/httpd/pki_access_log +/var/log/httpd/pki_error_log +/var/log/pluto/pluto.log" + + +#counter +found=0 + +# could do also $(find /var/log/ -type l) +for f in $FILES +do + if [ -L "$f" ]; then + echo "Processing $f" + mylink=$(readlink "$f") + unlink $f + touch $f + if [ -f "$mylink" ]; then + cp --attributes-only "$mylink" "$f" + fi + ((found+=1)) + fi +done + +# restart the needed services +if [ $found > 0 ] ; then + /usr/bin/systemctl restart httpd-*.service > /dev/null 2>/dev/null + /usr/bin/systemctl restart rsyslog.service > /dev/null 2>/dev/null +fi +