broken freshclam cron script in clamav-db-0.96.5-1.el5.art

Forum for getting help with Project Gamera, Spamassassin, Clamav, qmail-scanner and other anti-spam tools.
zerojj
New Forum User
New Forum User
Posts: 3
Joined: Sat Dec 19, 2009 12:50 am

broken freshclam cron script in clamav-db-0.96.5-1.el5.art

Unread post by zerojj »

posted this to atomic-repo-discuss@ but no response, so thought it might get some traction here:

Hi Scott & team,
Just ran through a yum update, and found that clamav-db-0.96.5-1.el5.art breaks freshclam updates.
Not sure if this is a custom package or if this needs to be floated upstream to clamav maintainers - I can do this if necessary.

I get the following mail from the cronjob:
/etc/cron.hourly/freshclam:
chown: cannot access `qscand.clamav': No such file or directory
chown: cannot access `qscand': No such file or directory
ERROR: Can't create temporary directory /var/clamav/clamav-80ee3c96cbc0c70b9354def7c1d68e62

Found that what seemed to be choking it up was the fact that there is an additional old DatabaseOwner field in /etc/freshclam.conf that is commented out.

Did a slight modification to the regex on the awk script to get the user from the file, and also updated the chown cmd to modern syntax

Code: Select all

[jens@serv2 ~]$ diff -u /etc/cron.hourly/freshclam.old /etc/cron.hourly/freshclam
--- /etc/cron.hourly/freshclam.old      2010-12-22 10:43:14.000000000 -0600
+++ /etc/cron.hourly/freshclam  2010-12-22 10:44:33.000000000 -0600
@@ -5,15 +5,15 @@
 
 ### fix log file if needed
 LOG_FILE="/var/log/clamav/freshclam.log"
-USER=`awk '/DatabaseOwner/ {print $2}' /etc/freshclam.conf`
+USER=`awk '/^DatabaseOwner/ {print $2}' /etc/freshclam.conf`
 if [ ! -f "$LOG_FILE" ]; then
     touch "$LOG_FILE"
     chmod 644 "$LOG_FILE"
-    chown $USER.$USER "$LOG_FILE"
+    chown $USER:$USER "$LOG_FILE"
 fi
 
 # User check event
-chown -R $USER.$USER /var/clamav
+chown -R $USER:$USER /var/clamav
 
 /usr/bin/freshclam \
     --quiet \
-- Jens
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Re: broken freshclam cron script in clamav-db-0.96.5-1.el5.a

Unread post by faris »

Thanks for the headsup. I'll take a look at ours when I get a chance. We mostly have RH4 systems but there are a few RH5s.
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
Post Reply