diff -Nur smeserver-clamav-2.7.0.old/createlinks smeserver-clamav-2.7.0/createlinks --- smeserver-clamav-2.7.0.old/createlinks 2020-12-15 10:05:24.000000000 -0500 +++ smeserver-clamav-2.7.0/createlinks 2021-01-02 23:22:08.027000000 -0500 @@ -5,7 +5,6 @@ my $panel = "manager"; panel_link("clamav", $panel); -my $event = "clamav-update"; # For templates in all main events @@ -17,7 +16,6 @@ /etc/logrotate.d/freshclam /usr/lib/tmpfiles.d/clamd.conf /usr/lib/systemd/system/clamd.service.d/50koozali.conf - /usr/lib/systemd/system/freshclam.service.d/50koozali.conf )) { templates2events("$_",qw( @@ -27,25 +25,41 @@ console-save email-update clamav-update + smeserver-clamav-update )); } # For templates only in certain individual events # Not required now -# templates2events("/etc/cron.daily/freshclam", "bootstrap-console-save"); +templates2events("/etc/cron.daily/freshclam", "bootstrap-console-save"); +templates2events("/etc/cron.d/clamav-update", "bootstrap-console-save" ); + +my $event = "clamav-update"; +templates2events("/etc/crontab", $event); +templates2events("/etc/systemd/system-preset/49-koozali.preset", $event ); +templates2events("/etc/cron.daily/freshclam", $event ); +templates2events("/etc/cron.d/clamav-update", $event ); +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/clamd"); -templates2events("/etc/crontab", "clamav-update"); -templates2events("/etc/systemd/system-preset/49-koozali.preset", "clamav-update"); # clamav-update events +my $event = "smeserver-clamav-update"; +templates2events("/etc/crontab", $event); +templates2events("/etc/systemd/system-preset/49-koozali.preset", $event ); +templates2events("/etc/cron.daily/freshclam", $event ); +templates2events("/etc/cron.d/clamav-update", $event ); + +safe_touch("root/etc/e-smith/templates/etc/cron.d/clamav-update"); event_link("systemd-default", $event, "88"); # updates all the service files etc event_link("systemd-reload", $event, "89"); # systemctl daemon-reload -event_link("clamav-update", $event, "99"); # Hopefully restarts clamd +event_link("clamav-update", $event, "99"); +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/clamd"); +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/freshclam"); # email-update events - required? -#my $event = "email-update"; -#event_link("clamav-update", $event, "89"); # Hopefully restarts clamd +$event = "email-update"; +safe_symlink("reload", "root/etc/e-smith/events/$event/services2adjust/clamd"); exit 0; diff -Nur smeserver-clamav-2.7.0.old/root/etc/e-smith/events/actions/clamav-update smeserver-clamav-2.7.0/root/etc/e-smith/events/actions/clamav-update --- smeserver-clamav-2.7.0.old/root/etc/e-smith/events/actions/clamav-update 2020-12-10 06:23:56.000000000 -0500 +++ smeserver-clamav-2.7.0/root/etc/e-smith/events/actions/clamav-update 2021-01-02 22:52:12.066000000 -0500 @@ -1,2 +1,2 @@ #!/usr/bin/bash -/usr/bin/systemctl restart clamd +#keeping that to help migration from older clamd diff -Nur smeserver-clamav-2.7.0.old/root/etc/e-smith/templates/usr/lib/systemd/system/clamd.service.d/50koozali.conf/40service smeserver-clamav-2.7.0/root/etc/e-smith/templates/usr/lib/systemd/system/clamd.service.d/50koozali.conf/40service --- smeserver-clamav-2.7.0.old/root/etc/e-smith/templates/usr/lib/systemd/system/clamd.service.d/50koozali.conf/40service 2020-12-07 13:58:23.000000000 -0500 +++ smeserver-clamav-2.7.0/root/etc/e-smith/templates/usr/lib/systemd/system/clamd.service.d/50koozali.conf/40service 2021-01-02 22:53:53.541000000 -0500 @@ -1,4 +1,3 @@ -# MEM="`head -1 ./env/MEMLIMIT`" [Service] { # memory limit to catch any memory leak before it kills the system @@ -6,4 +5,3 @@ $OUT .= ($clamd{MemLimit} > "1610612736") ? $clamd{MemLimit} : "1610612736"; } -ExecStartPre=-/sbin/e-smith/expand-template /etc/clamd.d/clamd.conf diff -Nur smeserver-clamav-2.7.0.old/root/etc/e-smith/templates/usr/lib/systemd/system/clamd.service.d/50koozali.conf/80install smeserver-clamav-2.7.0/root/etc/e-smith/templates/usr/lib/systemd/system/clamd.service.d/50koozali.conf/80install --- smeserver-clamav-2.7.0.old/root/etc/e-smith/templates/usr/lib/systemd/system/clamd.service.d/50koozali.conf/80install 2020-12-04 06:36:49.000000000 -0500 +++ smeserver-clamav-2.7.0/root/etc/e-smith/templates/usr/lib/systemd/system/clamd.service.d/50koozali.conf/80install 1969-12-31 19:00:00.000000000 -0500 @@ -1,2 +0,0 @@ -[Install] -WantedBy=sme-server.target diff -Nur smeserver-clamav-2.7.0.old/root/etc/e-smith/templates/usr/lib/systemd/system/freshclam.service.d/50koozali.conf/40service smeserver-clamav-2.7.0/root/etc/e-smith/templates/usr/lib/systemd/system/freshclam.service.d/50koozali.conf/40service --- smeserver-clamav-2.7.0.old/root/etc/e-smith/templates/usr/lib/systemd/system/freshclam.service.d/50koozali.conf/40service 2020-12-07 13:58:37.000000000 -0500 +++ smeserver-clamav-2.7.0/root/etc/e-smith/templates/usr/lib/systemd/system/freshclam.service.d/50koozali.conf/40service 1969-12-31 19:00:00.000000000 -0500 @@ -1,2 +0,0 @@ -[Service] -ExecStartPre=-/sbin/e-smith/expand-template /etc/freshclam.conf diff -Nur smeserver-clamav-2.7.0.old/root/etc/e-smith/templates/usr/lib/systemd/system/freshclam.service.d/50koozali.conf/80install smeserver-clamav-2.7.0/root/etc/e-smith/templates/usr/lib/systemd/system/freshclam.service.d/50koozali.conf/80install --- smeserver-clamav-2.7.0.old/root/etc/e-smith/templates/usr/lib/systemd/system/freshclam.service.d/50koozali.conf/80install 2020-12-04 06:37:00.000000000 -0500 +++ smeserver-clamav-2.7.0/root/etc/e-smith/templates/usr/lib/systemd/system/freshclam.service.d/50koozali.conf/80install 1969-12-31 19:00:00.000000000 -0500 @@ -1,2 +0,0 @@ -[Install] -WantedBy=sme-server.target diff -Nur smeserver-clamav-2.7.0.old/root/etc/e-smith/templates.metadata/etc/cron.d/clamav-update smeserver-clamav-2.7.0/root/etc/e-smith/templates.metadata/etc/cron.d/clamav-update --- smeserver-clamav-2.7.0.old/root/etc/e-smith/templates.metadata/etc/cron.d/clamav-update 1969-12-31 19:00:00.000000000 -0500 +++ smeserver-clamav-2.7.0/root/etc/e-smith/templates.metadata/etc/cron.d/clamav-update 2021-01-02 22:20:42.750000000 -0500 @@ -0,0 +1 @@ +DELETE=DELETE diff -Nur smeserver-clamav-2.7.0.old/root/etc/e-smith/templates.metadata/etc/cron.daily/freshclam smeserver-clamav-2.7.0/root/etc/e-smith/templates.metadata/etc/cron.daily/freshclam --- smeserver-clamav-2.7.0.old/root/etc/e-smith/templates.metadata/etc/cron.daily/freshclam 2020-12-02 11:37:01.000000000 -0500 +++ smeserver-clamav-2.7.0/root/etc/e-smith/templates.metadata/etc/cron.daily/freshclam 2021-01-02 22:19:58.444000000 -0500 @@ -1 +1 @@ -PERMS=0755 +DELETE=DELETE diff -Nur smeserver-clamav-2.7.0.old/root/etc/yum/post-actions/clamd.action smeserver-clamav-2.7.0/root/etc/yum/post-actions/clamd.action --- smeserver-clamav-2.7.0.old/root/etc/yum/post-actions/clamd.action 1969-12-31 19:00:00.000000000 -0500 +++ smeserver-clamav-2.7.0/root/etc/yum/post-actions/clamd.action 2021-01-02 22:48:10.779000000 -0500 @@ -0,0 +1,8 @@ +#action to avoid freshclam from cron +clamav-update:any:/usr/bin/rm -f /etc/cron.d/clamav-update +#old freshclam +clam*:any:/usr/bin/rm -f /etc/cron.daily/freshclam +#avoid config not needed +clamav-filesystem:any:/usr/bin/rm -f /etc/clamd.d/scan.conf +clam*:any:/sbin/e-smith/signal-event smeserver-clamav-update +clamav-update:any:/sbin/e-smith/expand-template /etc/logrotate.d/clamav-update diff -Nur smeserver-clamav-2.7.0.old/root/usr/lib/systemd/system/clamd.service smeserver-clamav-2.7.0/root/usr/lib/systemd/system/clamd.service --- smeserver-clamav-2.7.0.old/root/usr/lib/systemd/system/clamd.service 2020-12-09 07:34:47.000000000 -0500 +++ smeserver-clamav-2.7.0/root/usr/lib/systemd/system/clamd.service 2021-01-02 22:10:07.220000000 -0500 @@ -1,18 +1,20 @@ [Unit] # New service file specifically for SME # Copied from clamav install file -Description = clamd scanner (%i) daemon +Description=clamd scanner (%i) daemon Documentation=man:clamd(8) man:clamd.conf(5) https://www.clamav.net/documents/ -After = syslog.target nss-lookup.target network.target +After=syslog.target nss-lookup.target network.target [Service] Type = forking -ExecStart = /usr/sbin/clamd -c /etc/clamd.d/clamd.conf +ExecStartPre=/sbin/e-smith/service-status clamd +ExecStartPre=-/sbin/e-smith/expand-template /etc/clamd.d/clamd.conf +ExecStart=/usr/sbin/clamd -c /etc/clamd.d/clamd.conf # Reload the database ExecReload=/bin/kill -USR2 $MAINPID -Restart = on-failure +Restart=on-failure TimeoutStartSec=420 [Install] -WantedBy = multi-user.target +WantedBy=sme-server.target diff -Nur smeserver-clamav-2.7.0.old/root/usr/lib/systemd/system/clamd@.service.d/51koozali.conf smeserver-clamav-2.7.0/root/usr/lib/systemd/system/clamd@.service.d/51koozali.conf --- smeserver-clamav-2.7.0.old/root/usr/lib/systemd/system/clamd@.service.d/51koozali.conf 1969-12-31 19:00:00.000000000 -0500 +++ smeserver-clamav-2.7.0/root/usr/lib/systemd/system/clamd@.service.d/51koozali.conf 2021-01-02 18:47:46.844000000 -0500 @@ -0,0 +1,5 @@ +[Service] +# we do not allow mulitple instance on Koozali SME Server +ExecStart= +ExecStart=/bin/false + diff -Nur smeserver-clamav-2.7.0.old/root/usr/lib/systemd/system/freshclam.service smeserver-clamav-2.7.0/root/usr/lib/systemd/system/freshclam.service --- smeserver-clamav-2.7.0.old/root/usr/lib/systemd/system/freshclam.service 2020-12-09 08:08:07.000000000 -0500 +++ smeserver-clamav-2.7.0/root/usr/lib/systemd/system/freshclam.service 2021-01-02 22:16:02.495000000 -0500 @@ -1,7 +1,4 @@ [Unit] -# Shamelessly hacked from examples online -# No idea if this is correct - Description=ClamAV virus database updater Documentation=man:freshclam(1) man:freshclam.conf(5) https://www.clamav.net/documents @@ -13,9 +10,10 @@ [Service] Type=forking +ExecStartPre=/sbin/e-smith/service-status freshclam ExecStart=/usr/bin/freshclam -d --config-file=/etc/freshclam.conf -Restart = on-failure +Restart=on-failure StandardOutput=syslog [Install] -WantedBy=multi-user.target +WantedBy=sme-server.target diff -Nur smeserver-clamav-2.7.0.old/root/etc/e-smith/templates/etc/cron.daily/freshclam/10freshclam smeserver-clamav-2.7.0/root/etc/e-smith/templates/etc/cron.daily/freshclam/10freshclam --- smeserver-clamav-2.7.0.old/root/etc/e-smith/templates/etc/cron.daily/freshclam/10freshclam 1969-12-31 19:00:00.000000000 -0500 +++ smeserver-clamav-2.7.0/root/etc/e-smith/templates/etc/cron.daily/freshclam/10freshclam 2013-01-31 16:31:43.000000000 -0500 @@ -0,0 +1,4 @@ +#! /bin/sh +# We do not run freshclam here, because an always-running supervised freshclam +# is used in SME Server +exit 0