store | blogs | forums | twitter | facebook | wiki | downloads | support portal
Atomic Secure Linux
It is currently Thu Nov 27, 2014 1:19 am

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: broken freshclam cron script in clamav-db-0.96.5-1.el5.art
Unread postPosted: Thu Dec 23, 2010 10:25 pm 
Offline
New Forum User
New Forum User

Joined: Sat Dec 19, 2009 12:50 am
Posts: 3
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:
[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


Top
 Profile  
 
 Post subject: Re: broken freshclam cron script in clamav-db-0.96.5-1.el5.a
Unread postPosted: Fri Dec 24, 2010 2:13 pm 
Offline
Long Time Forum Regular
Long Time Forum Regular

Joined: Thu Dec 09, 2004 11:19 am
Posts: 2107
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>


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group