Mailing List Archive

[clamav-users] what initiates freshclam?
I'm still experimenting with Clam and I've got 103.4 installed on an OEL 7.9 box. I've got freshclam configured to download new updates every few hours. I can manually run freshclam and successfully receive updates and I can manually run clamscan successfully.

If I run a ps command, I see /usr/share/clamav/freshclam-sleep is running so I'm assuming that this calls freshclam on the schedule. But what is launching this on startup?

There are no cronjobs configured. When I look at my systemd services, I see one named clamav-freshclam but it is disabled and not running. I expanded my search and found a total of 4 services with 'clam' in the title (clamav-freshclam, clamav-clamonacc, clamd@, and clamonacc) but none of them are running and they are all currently disabled.

Is it some other service that doesn't have 'clam' in the name?

Sent with [ProtonMail](https://protonmail.com/) Secure Email.
Re: [clamav-users] what initiates freshclam? [ In reply to ]
novpenguincne via clamav-users wrote:
> I'm still experimenting with Clam and I've got 103.4 installed on an OEL
> 7.9 box.

What is "OEL"? I'm guessing it's some Red Hat derivative.

>  I've got freshclam configured to download new updates every
> few hours.  I can manually run freshclam and successfully receive
> updates and I can manually run clamscan successfully.
>
> If I run a ps command, I see /usr/share/clamav/freshclam-sleep is
> running so I'm assuming that this calls freshclam on the schedule.  But
> what is launching this on startup?
>
> There are no cronjobs configured.  When I look at my systemd services, I
> see one named clamav-freshclam but it is disabled and not running.  I
> expanded my search and found a total of 4 services with 'clam' in the
> title (clamav-freshclam, clamav-clamonacc, clamd@, and clamonacc) but
> none of them are running and they are all currently disabled.
>
> Is it some other service that doesn't have 'clam' in the name?

"grep -r freshclam /usr/lib/systemd/ /etc/systemd/" might turn up a
pointer to the systemd unit that manages this. "rpm -qf
/usr/share/clamav/freshclam-sleep" will probably tell you what package
this file belongs to.

TBH this seems like a very odd way to manage freshclam, as systemd
includes methods to call something like freshclam on a schedule, or
manage it directly either in the foreground or as a traditional
background daemon.

-kgd

_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Re: [clamav-users] what initiates freshclam? [ In reply to ]
OEL = Oracle Enterprise Linux

Under /usr/lib/systemd/system, there are the four clam*.service files. But since none of them are active or enabled, I don't think can be the source. I scanned the entire file system for cl*.service and they are the only ones I can find.

It's not a big issue. It's working. I was just curious for my own knowledge.

Sent with ProtonMail Secure Email.

??????? Original Message ???????

On Thursday, January 6th, 2022 at 9:59 AM, Kris Deugau <kdeugau@vianet.ca> wrote:


>
> What is "OEL"? I'm guessing it's some Red Hat derivative.
>
>
> "grep -r freshclam /usr/lib/systemd/ /etc/systemd/" might turn up a
>
> pointer to the systemd unit that manages this. "rpm -qf
>
> /usr/share/clamav/freshclam-sleep" will probably tell you what package
>
> this file belongs to.
>
> TBH this seems like a very odd way to manage freshclam, as systemd
>
> includes methods to call something like freshclam on a schedule, or
>
> manage it directly either in the foreground or as a traditional
>
> background daemon.
>
> -kgd
>

_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Re: [clamav-users] what initiates freshclam? [ In reply to ]
Is it a systemd timer? It is on my OpenSuse system.

Try "systemctl list-timers".

Or "systemctl status freshclam.timer".

Dave.

On 2022-01-06 11:15, novpenguincne via clamav-users wrote:
> OEL = Oracle Enterprise Linux
>
> Under /usr/lib/systemd/system, there are the four clam*.service files. But since none of them are active or enabled, I don't think can be the source. I scanned the entire file system for cl*.service and they are the only ones I can find.
>
> It's not a big issue. It's working. I was just curious for my own knowledge.
>
> Sent with ProtonMail Secure Email.
>
>


_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Re: [clamav-users] what initiates freshclam? [ In reply to ]
novpenguincne via clamav-users wrote:
> OEL = Oracle Enterprise Linux
>
> Under /usr/lib/systemd/system, there are the four clam*.service files. But since none of them are active or enabled, I don't think can be the source. I scanned the entire file system for cl*.service and they are the only ones I can find.

The grep command will search the contents of the files; I suggested it
since you haven't found a match by filename.

> It's not a big issue. It's working. I was just curious for my own knowledge.

Well, now you've got some of *us* curious, because like I said, this is
a very strange way to call freshclam. I really can't think of a good
reason to wrap it up this way for most systems.

-kgd

_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Re: [clamav-users] what initiates freshclam? [ In reply to ]
On 1/6/2022 7:13 AM, novpenguincne via clamav-users wrote:
> I'm still experimenting with Clam and I've got 103.4 installed on an
> OEL 7.9 box.  I've got freshclam configured to download new updates
> every few hours.  I can manually run freshclam and successfully
> receive updates and I can manually run clamscan successfully.
>
> If I run a ps command, I see /usr/share/clamav/freshclam-sleep is
> running so I'm assuming that this calls freshclam on the schedule. 
> But what is launching this on startup?

I'm guessing OEL is Oracle Enterprise Linux, an RHEL derivative.

The default Clam packages install /etc/cron.d/clamav-update from the
clamav-update RPM. But you can disable that and use the systemd timer
services, instead.
Re: [clamav-users] what initiates freshclam? [ In reply to ]
That's it! Under /etc/crond.d, there is a clamav-update cron that runs freshclam-sleep every 3 hours. So this overrides the frequency setting in the freshclam.conf file.

Mystery solved. I checked for cron jobs but I only looked in /var/spool/cron and didn't think to check in /etc/crond.d.

Thank you!

Sent with [ProtonMail](https://protonmail.com/) Secure Email.

??????? Original Message ???????

> The default Clam packages install /etc/cron.d/clamav-update from the clamav-update RPM. But you can disable that and use the systemd timer services, instead.
Re: [clamav-users] what initiates freshclam? [ In reply to ]
--On Thursday, January 06, 2022 7:51 PM +0000 novpenguincne via
clamav-users <clamav-users@lists.clamav.net> wrote:

> Mystery solved. I checked for cron jobs but I only looked in
> /var/spool/cron and didn't think to check in /etc/crond.d.

Long ago (before systemd) the Red Hat family stopped using the root crontab
for periodic system services, because it's not package-friendly. There was
no way to know which line in the crontab was "owned" by which package, so
it couldn't be cleaned up when removing a package.

Instead, they replaced that mechanism with /usr/bin/run-parts run from
/etc/cron.d/0hourly. This allows packages to simply drop their crontab
services into one of the /etc/cron.* directories.

I now use "ls /etc/cron*" to look for scripts that run periodically. Until
I learned how to use systemd timer units (which are much more flexible and
can run in parallel), I put my own scripts in there.

One reason to switch to systemd is that you no longer need to implement a
random delay in your own script to reduce server load from lots of client
scripts slamming the server at the top of the hour. See the
RandomizedDelaySec and FixedRandomDelay options in the timer help.


_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Re: [clamav-users] what initiates freshclam? [OT] [ In reply to ]
Hi there,

On Fri, 7 Jan 2022, Kenneth Porter wrote:

> ...
> One reason to switch to systemd is that you no longer need to implement a
> random delay in your own script to reduce server load from lots of client
> scripts slamming the server at the top of the hour. See the
> RandomizedDelaySec and FixedRandomDelay options in the timer help.

There's a metaphor about babies and bathwater around here somewhere.

IMHO this is a pretty unconvincing reason to change your init system,
especially to one which is both as new as systemd, and as capable of
stupidity on a scale never before seen in any init system. A couple
of examples here (the wanton renaming of Ethernet interfaces and, to
the amazement of all concerned, the killing of an ext3 fsck boot job
because it took longer then 90 seconds) both necessitated trips to
remote sites to recover from the installation of systemd by Debian's
packaging system during the upgrade to 'Buster'.

Be very sure you've tested the new setup if you switch to systemd.

Personally, I avoid it like covid-19.

--

73,
Ged.

_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Re: [clamav-users] what initiates freshclam? [OT] [ In reply to ]
G.W. Haywood via clamav-users wrote:
> IMHO this is a pretty unconvincing reason to change your init system,
> especially to one which is both as new as systemd, and as capable of
> stupidity on a scale never before seen in any init system.  A couple
> of examples here (the wanton renaming of Ethernet interfaces

IIRC most of that one can be laid at the feet of the kernel developers
trying to make hardware enumeration more predictable, and systemd is
just one of several places the sysadmin can try to clean up the pieces.

My understanding is about 50% "WTF?", but supposedly the change came
about because a physical device on a known physical slot location will
show up in the PCI hardware enumeration in a semirandom order. The
people having most issue with this were people using "many" multiport
NICs to build routers, and they were apparently having real problems
with logical interfaces semirandomly migrating from card to card to
card. When you're actively trying to decide where to fling packets
around this is a Big Problem(TM).

-kgd

_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Re: [clamav-users] what initiates freshclam? [OT] [ In reply to ]
--On Friday, January 07, 2022 10:45 AM -0500 Kris Deugau
<kdeugau@vianet.ca> wrote:

> IIRC most of that one can be laid at the feet of the kernel developers
> trying to make hardware enumeration more predictable, and systemd is just
> one of several places the sysadmin can try to clean up the pieces.

Agreed. I recommend taking further discussion of systemd to its own list:

https://lists.freedesktop.org/archives/systemd-devel

(Unless it's discussion of how ClamAV interacts with systemd, such as in
the optional unit files for launching freshclam that can replace the old
crontab drop-in file.)


_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml