[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: error from Klamav

Thanks for your help, Scott.

On 30/08/11 11:14, Scott Ferguson wrote:
On 30/08/11 19:18, Tony van der Hoff wrote:
On 30/08/11 10:03, Scott Ferguson wrote:
On 30/08/11 18:09, Tony van der Hoff wrote:
I am getting an error after the nightly scan by KlamAV as follows:

From: root@tony-lx.xxx (Cron Daemon)
To: tony@tony-lx.xxx
Subject: Cron <tony@tony-lx>
/home/tony/.klamav/ScanWithKlamav_170811104108.sh '/home/tony/'

Which Debian release are you running??


That script "used" to be for KDE context menu a long time ago.

cat: /home//.DCOPserver_tony-lx_:0: No such file or directory
call failed
QLayout "unnamed" added to Klamav "KlamAV ", which already has a layout

Does anyone have any clues to what this means, and more importantly,
to fix it?

Thanks in advance,

Has the process previously worked successfully??

No. I recently installed it with synaptic, configured it to scan my
home, and left it at that.
It seems to be looking for .DCOPserver_tony-lx_:0 in /home, whereas that
file actually exists in /home/tony.

I had no problem manually scanning a home directoy using Klamav - when I
used Klamav to setup a scheduled scan it created:-

After looking (quickly) at that script I suspect (strongly) that the
${USER} is probably not being populated. You could try replacing it with
the hardcoded value eg:-
line 6 would become:-
DCOPSERVER=`cat /home/tony/.DCOPserver_${HOSTNAME}_:) | grep local`

In fact I suggest replace the HOSTNAME variable as well as your error
string doesn't contain either the $USER or the $HOSTNAME (the script
populates $HOSTNAME with 'hostname' which doesn't seem helpful.

If that solves the problem please file a bug report.

- Doing a manual scan works fine, as you found.

- My crontab was appended (presumably by the installer) with:

# KlamAV Scheduled Scan of /home/tony/
0 6 * * * /home/tony/.klamav/ScanWithKlamav_170811104108.sh '/home/tony/'
# This file was written by KlamAV using code disembowelled from KCron.
# KCron is (c) 1999, Gary Meyer; if your cron file looks screwed up
# then that is probably (c) Robert Hogan and you should file a bug report.
# Original notice from KCron reads:
# Although KCron supports most crontab formats, use care when editing.
# Note: Lines beginning with "#\" indicates a disabled task.

- My $USER is set in my login environment, but presumably not in the cron environment:

tony@tony-lx:~$ echo $USER

- The Hostname (tony-lx) is actually recognised by the script. In fact it is set within the script:

So, it is the lack of $USER that is the problem, as you correctly observe. I'm not sure whether this should be set by cron; I suspect not. From man 5 crontab:

Several environment variables are set up automatically by the cron(8) daemon. SHELL is set to /bin/sh, and LOGNAME and HOME are set from the /etc/passwd line of the crontab's owner. PATH is set to "/usr/bin:/bin". HOME, SHELL, and PATH may be overridden by settings in the crontab; LOGNAME is the user that the job is running from, and may not be changed.

(Another note: the LOGNAME variable is sometimes called USER on BSD systems... on these systems, USER will be set also.)

Therefore it appears that (on Linux at least) the KlamAV script should be using $LOGNAME rather than $USER. I'll amend that, and report back tomorrow, after the next cron run at 0600.

If it succeeds, and no-one here has alternative suggestions, I'll raise a bug.

Tony van der Hoff        | mailto:tony@vanderhoff.org
Buckinghamshire, England |

Reply to: