Mailing List Archive

[clamav-users] freshclam-sleep doesn't exist in epel8 packages
in redhat 7 :

[14:56:32][root@nirvana2 logrotate.d]$ repoquery --list clamav-update
/etc/cron.d/clamav-update
/etc/freshclam.conf
/etc/logrotate.d/clamav-update
/etc/sysconfig/freshclam
/usr/bin/freshclam
/usr/lib/systemd/system/clamav-freshclam.service
/usr/lib64/libfreshclam.so.2
/usr/lib64/libfreshclam.so.2.0.1
/usr/share/clamav/freshclam-sleep
/usr/share/man/man1/freshclam.1.gz
/usr/share/man/man5/freshclam.conf.5.gz
/var/lib/clamav/bytecode.cld
/var/lib/clamav/daily.cld
/var/lib/clamav/freshclam.dat
/var/lib/clamav/main.cvd
/var/log/freshclam.log


in redhat 8 :

[14:59:08][root@nirvana1 etc]$ repoquery --list clamav-update-0.103.7-1.el8.x86_64
Updating Subscription Management repositories.
Last metadata expiration check: 3:14:10 ago on Fri 28 Oct 2022 11:45:17 AM EDT.
/etc/freshclam.conf
/usr/bin/freshclam
/usr/lib/.build-id
/usr/lib/.build-id/6e
/usr/lib/.build-id/6e/f1ca6b2a211a41ae538116294cc972a208bfeb
/usr/lib/.build-id/8c
/usr/lib/.build-id/8c/dba8a3944af9b72cc57769b5b7bb6a713bc229
/usr/lib/systemd/system/clamav-freshclam.service
/usr/lib64/libfreshclam.so.2
/usr/lib64/libfreshclam.so.2.0.1
/usr/share/man/man1/freshclam.1.gz
/usr/share/man/man5/freshclam.conf.5.gz
/var/lib/clamav/bytecode.cld
/var/lib/clamav/daily.cld
/var/lib/clamav/freshclam.dat
/var/lib/clamav/main.cvd


the redhat 8 package is missing the following :

/etc/cron.d/clamav-update
/usr/share/clamav/freshclam-sleep

is this a normal behavior ?
Re: [clamav-users] freshclam-sleep doesn't exist in epel8 packages [ In reply to ]
Hi there,

On Fri, 28 Oct 2022, khodor barakat via clamav-users wrote:

> ...
> the redhat 8 package is missing the following :
>
> /etc/cron.d/clamav-update
> /usr/share/clamav/freshclam-sleep
>
> is this a normal behavior ?

I think you should ask Red Hat. They don't exist in the official source.

--

73,
Ged.
_______________________________________________

Manage your clamav-users mailing list subscription / unsubscribe:
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/Cisco-Talos/clamav-documentation

https://docs.clamav.net/#mailing-lists-and-chat
Re: [clamav-users] freshclam-sleep doesn't exist in epel8 packages [ In reply to ]
redhat doesn't support this package,

this package is vi epel8

i also looked at https://docs.clamav.net/ and couldn't find anything that talks about freshclam-sleep

in fact, that existed in epel7 and the freshclam-sleep is the script used to run clamav updates vi cron, i had this setup on my rhel7 system but now after migration , the file was not within the clamav-update package in epel8 menahwile it is listed on epel7

[19:30:33][root@server1 active]$ cat /usr/share/clamav/freshclam-sleep
#! /bin/bash
# Copyright (C) 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


FRESHCLAM_MOD=$[ 3*60 ] # 3 hours

f=/etc/sysconfig/freshclam
test ! -e "$f" || . "$f"


case x"$1" in
(xnow) FRESHCLAM_DELAY=0;;
(x|xrandom) : ${FRESHCLAM_DELAY:=$[ 0x`hostid` ]};;
(*) FRESHCLAM_DELAY=$1;;
esac

set -e

case $FRESHCLAM_DELAY in
(disabled-warn)
echo $"\
WARNING: update of clamav database is disabled; please see
'$f'
for information how to enable the periodic update resp. how to turn
off this message." >&2
exit 1
;;

(disabled)
exit 0
;;

(*)
let FRESHCLAM_MOD*=60
sleep $[ (FRESHCLAM_DELAY % FRESHCLAM_MOD + FRESHCLAM_MOD) % FRESHCLAM_MOD ]
;;
esac

/usr/bin/freshclam --quiet > /dev/null

Introduction - ClamAV Documentation<https://docs.clamav.net/>
ClamAV. ClamAV is an open source (GPLv2) anti-virus toolkit, designed especially for e-mail scanning on mail gateways. It provides a number of utilities including a flexible and scalable multi-threaded daemon, a command line scanner and advanced tool for automatic database updates.
docs.clamav.net



________________________________
From: clamav-users <clamav-users-bounces@lists.clamav.net> on behalf of G.W. Haywood via clamav-users <clamav-users@lists.clamav.net>
Sent: Friday, October 28, 2022 6:28 PM
To: khodor barakat via clamav-users <clamav-users@lists.clamav.net>
Cc: G.W. Haywood <clamav@jubileegroup.co.uk>
Subject: Re: [clamav-users] freshclam-sleep doesn't exist in epel8 packages

Hi there,

On Fri, 28 Oct 2022, khodor barakat via clamav-users wrote:

> ...
> the redhat 8 package is missing the following :
>
> /etc/cron.d/clamav-update
> /usr/share/clamav/freshclam-sleep
>
> is this a normal behavior ?

I think you should ask Red Hat. They don't exist in the official source.

--

73,
Ged.
_______________________________________________

Manage your clamav-users mailing list subscription / unsubscribe:
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/Cisco-Talos/clamav-documentation

https://docs.clamav.net/#mailing-lists-and-chat
Re: [clamav-users] freshclam-sleep doesn't exist in epel8 packages [ In reply to ]
Hi,

redhat doesn't support this package,

this package is vi epel8

i also looked at https://docs.clamav.net/ and couldn't find anything that talks about freshclam-sleep

in fact, that existed in epel7 and the freshclam-sleep is the script used to run clamav updates vi cron, i had this setup on my rhel7 system but now after migration , the file was not within the clamav-update package in epel8 menahwile it is listed on epel7

[19:30:33][root@server1 active]$ cat /usr/share/clamav/freshclam-sleep
#! /bin/bash
# Copyright (C) 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


FRESHCLAM_MOD=$[ 3*60 ] # 3 hours

f=/etc/sysconfig/freshclam
test ! -e "$f" || . "$f"


case x"$1" in
(xnow) FRESHCLAM_DELAY=0;;
(x|xrandom) : ${FRESHCLAM_DELAY:=$[ 0x`hostid` ]};;
(*) FRESHCLAM_DELAY=$1;;
esac

set -e

case $FRESHCLAM_DELAY in
(disabled-warn)
echo $"\
WARNING: update of clamav database is disabled; please see
'$f'
for information how to enable the periodic update resp. how to turn
off this message." >&2
exit 1
;;

(disabled)
exit 0
;;

(*)
let FRESHCLAM_MOD*=60
sleep $[ (FRESHCLAM_DELAY % FRESHCLAM_MOD + FRESHCLAM_MOD) % FRESHCLAM_MOD ]
;;
esac

/usr/bin/freshclam --quiet > /dev/null

Introduction - ClamAV Documentation<https://docs.clamav.net/>
ClamAV. ClamAV is an open source (GPLv2) anti-virus toolkit, designed especially for e-mail scanning on mail gateways. It provides a number of utilities including a flexible and scalable multi-threaded daemon, a command line scanner and advanced tool for automatic database updates.
docs.clamav.net



________________________________
From: clamav-users <clamav-users-bounces@lists.clamav.net> on behalf of G.W. Haywood via clamav-users <clamav-users@lists.clamav.net>
Sent: Friday, October 28, 2022 6:28 PM
To: khodor barakat via clamav-users <clamav-users@lists.clamav.net>
Cc: G.W. Haywood <clamav@jubileegroup.co.uk>
Subject: Re: [clamav-users] freshclam-sleep doesn't exist in epel8 packages

Hi there,

On Fri, 28 Oct 2022, khodor barakat via clamav-users wrote:

> ...
> the redhat 8 package is missing the following :
>
> /etc/cron.d/clamav-update
> /usr/share/clamav/freshclam-sleep
>
> is this a normal behavior ?

I think you should ask Red Hat. They don't exist in the official source.

--

73,
Ged.
_______________________________________________

Manage your clamav-users mailing list subscription / unsubscribe:
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/Cisco-Talos/clamav-documentation

https://docs.clamav.net/#mailing-lists-and-chat
Re: [clamav-users] freshclam-sleep doesn't exist in epel8 packages [ In reply to ]
Looks like a nudge to switch to the systemd service instead of a cron
listing. Try:

systemctl enable clamav-freshclam

I'm a little surprised that they didn't use a systemd timer.


_______________________________________________

Manage your clamav-users mailing list subscription / unsubscribe:
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/Cisco-Talos/clamav-documentation

https://docs.clamav.net/#mailing-lists-and-chat
Re: [clamav-users] freshclam-sleep doesn't exist in epel8 packages [ In reply to ]
do you have any documentation about the service, i know that the service is installed within the package but wondering what extra config i need to add

[20:36:39][root@nirvana1 ~]$ systemctl status clamav-freshclam.service
● clamav-freshclam.service - ClamAV virus database updater
Loaded: loaded (/usr/lib/systemd/system/clamav-freshclam.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: man:freshclam(1)
man:freshclam.conf(5)
https://docs.clamav.net/
[20:36:50][root@nirvana1 ~]$
[20:36:50][root@nirvana1 ~]$
[20:36:50][root@nirvana1 ~]$ cat /usr/lib/systemd/system/clamav-freshclam.service
[Unit]
Description=ClamAV virus database updater
Documentation=man:freshclam(1) man:freshclam.conf(5) https://docs.clamav.net/
# If user wants it run from cron, don't start the daemon.
# ConditionPathExists=!/etc/cron.d/clamav-update
Wants=network-online.target
After=network-online.target

[Service]
ExecStart=/usr/bin/freshclam -d --foreground=true

[Install]
WantedBy=multi-user.target
[20:36:55][root@nirvana1 ~]$



________________________________
From: clamav-users <clamav-users-bounces@lists.clamav.net> on behalf of Kenneth Porter <shiva@sewingwitch.com>
Sent: Friday, October 28, 2022 8:33 PM
To: clamav-users@lists.clamav.net <clamav-users@lists.clamav.net>
Subject: Re: [clamav-users] freshclam-sleep doesn't exist in epel8 packages

Looks like a nudge to switch to the systemd service instead of a cron
listing. Try:

systemctl enable clamav-freshclam

I'm a little surprised that they didn't use a systemd timer.


_______________________________________________

Manage your clamav-users mailing list subscription / unsubscribe:
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/Cisco-Talos/clamav-documentation

https://docs.clamav.net/#mailing-lists-and-chat
Re: [clamav-users] freshclam-sleep doesn't exist in epel8 packages [ In reply to ]
On 10/28/2022 5:38 PM, khodor barakat via clamav-users wrote:
> do you have any documentation about the service, i know that the
> service is installed within the package but wondering what extra
> config i need to add

Try "man freshclam".

Here's an online copy but I don't know what version it's for.

https://linux.die.net/man/1/freshclam


_______________________________________________

Manage your clamav-users mailing list subscription / unsubscribe:
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/Cisco-Talos/clamav-documentation

https://docs.clamav.net/#mailing-lists-and-chat
Re: [clamav-users] freshclam-sleep doesn't exist in epel8 packages [ In reply to ]
thanks a lot i will review
________________________________
From: clamav-users <clamav-users-bounces@lists.clamav.net> on behalf of Kenneth Porter <shiva@sewingwitch.com>
Sent: Friday, October 28, 2022 8:47 PM
To: clamav-users@lists.clamav.net <clamav-users@lists.clamav.net>
Subject: Re: [clamav-users] freshclam-sleep doesn't exist in epel8 packages

On 10/28/2022 5:38 PM, khodor barakat via clamav-users wrote:
> do you have any documentation about the service, i know that the
> service is installed within the package but wondering what extra
> config i need to add

Try "man freshclam".

Here's an online copy but I don't know what version it's for.

https://linux.die.net/man/1/freshclam


_______________________________________________

Manage your clamav-users mailing list subscription / unsubscribe:
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/Cisco-Talos/clamav-documentation

https://docs.clamav.net/#mailing-lists-and-chat
Re: [clamav-users] freshclam-sleep doesn't exist in epel8 packages [ In reply to ]
Also look at "man freshclam.conf".

I don't see any facility to randomize the check times, as
freshclam-sleep provides. That's where a systemd timer would be nice, as
it provides a rich set of syntax for random sleeps.


_______________________________________________

Manage your clamav-users mailing list subscription / unsubscribe:
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/Cisco-Talos/clamav-documentation

https://docs.clamav.net/#mailing-lists-and-chat
Re: [clamav-users] freshclam-sleep doesn't exist in epel8 packages [ In reply to ]
do you think i should create a freshclam.service with timer and reference the clamav-freshclam.service , also in freshclam.conf the checks by default is set to 12 checks by day and you can change that,

also found this article dated to 2020

https://www.golinuxcloud.com/steps-install-configure-clamav-antivirus-centos-linux/#33_On_CentOS_8_with_systemd_clamav-freshclamservice


not sure if the service was enhanced since 2020 to support sleep , since also in my logs i do see that calls freshclam :"received signal to wake up"

Received signal: wake up
ClamAV update process started at Tue Nov 1 10:17:30 2022
daily.cld database is up-to-date (version: 26706, sigs: 2009713, f-level: 90, builder: raynman)
main.cvd database is up-to-date (version: 62, sigs: 6647427, f-level: 90, builder: sigmgr)
bytecode.cvd database is up-to-date (version: 333, sigs: 92, f-level: 63, builder: awillia2)
--------------------------------------
Received signal: wake up
ClamAV update process started at Tue Nov 1 12:17:30 2022
daily.cld database is up-to-date (version: 26706, sigs: 2009713, f-level: 90, builder: raynman)
main.cvd database is up-to-date (version: 62, sigs: 6647427, f-level: 90, builder: sigmgr)
bytecode.cvd database is up-to-date (version: 333, sigs: 92, f-level: 63, builder: awillia2)
--------------------------------------



________________________________
From: clamav-users <clamav-users-bounces@lists.clamav.net> on behalf of Kenneth Porter <shiva@sewingwitch.com>
Sent: Friday, October 28, 2022 8:52 PM
To: clamav-users@lists.clamav.net <clamav-users@lists.clamav.net>
Subject: Re: [clamav-users] freshclam-sleep doesn't exist in epel8 packages

Also look at "man freshclam.conf".

I don't see any facility to randomize the check times, as
freshclam-sleep provides. That's where a systemd timer would be nice, as
it provides a rich set of syntax for random sleeps.


_______________________________________________

Manage your clamav-users mailing list subscription / unsubscribe:
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/Cisco-Talos/clamav-documentation

https://docs.clamav.net/#mailing-lists-and-chat
Re: [clamav-users] freshclam-sleep doesn't exist in epel8 packages [ In reply to ]
On 11/1/2022 10:51 AM, khodor barakat via clamav-users wrote:
> do you think i should create a freshclam.service with timer and
> reference the clamav-freshclam.service , also in freshclam.conf the
> checks by default is set to 12 checks by day and you can change that,

freshclam-sleep is a hack to allow cron to start freshclam at a random
time. A systemd timer unit already has this ability, so it can invoke
its service at a random start time. Just invoke freshclam as a type
oneshot service (the default) with no arguments. The service will
attempt to perform the update once and then exit. The matching systemd
timer unit will be responsible for the policy of repeating the attempts.

Compare to certbot-renew.timer, which renews LetsEncrypt certificates
(below). You'll want to change the OnCalendar value to something
reasonable for ClamAV signature updates. End users can install a
"drop-in" file to customize a systemd unit without editing the original
package files. This is useful to change the frequency of freshclam
invocations. Look for "drop-in" here:

https://www.freedesktop.org/software/systemd/man/systemd.unit.html


File certbot-renew.timer, an example systemd timer unit:

[Unit]
Description=This is the timer to set the schedule for automated renewals

[Timer]
OnCalendar=*-*-* 00/12:00:00
RandomizedDelaySec=12hours
Persistent=true

[Install]
WantedBy=timers.target

_______________________________________________

Manage your clamav-users mailing list subscription / unsubscribe:
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/Cisco-Talos/clamav-documentation

https://docs.clamav.net/#mailing-lists-and-chat