Author Topic: avastcmd in crontab  (Read 7706 times)

0 Members and 1 Guest are viewing this topic.

DeMan

  • Guest
avastcmd in crontab
« on: January 15, 2007, 12:05:59 PM »
hi,

I want avast to check my samba server on a regular bases for virusses.

My crontab looks like this:

0 20 * * *     /usr/bin/avastcmd -a -c -i -t A -r /var/log/avast4/avast-scan.log /

But this command is never executed.

If I run this command manually as root everthing runs just fine.

Any hint is apreciated.

Offline zilog

  • Avast team
  • Advanced Poster
  • *
  • Posts: 957
  • or #f0; daa; add a,#a0; adc a,#40
Re: avastcmd in crontab
« Reply #1 on: January 15, 2007, 07:31:56 PM »
Hallo,
there might be various causes:

1) is the command executed by cron or not? Try to replace it with something trivial, like "echo hello >somelogfile" etc.

2) whis user this crontab belongs to? I suppose it's different user than root (because You stated that avastcmd works fine under root), but then, are you able to run avastcmd manually under that user?

3) when you are sure that the command IS executed, and WORKS normally, then prefix the /usr/bin/avastcmd with "strace -f >your.log 2>&1 /usr/bin/avastcmd .....", and analyse the "your.log" file (or paste it here and we'll have look at it).

Regards,
PC
May's Law: Software efficiency halves every 18 months, compensating Moore's Law. (David May, INMOS)

DeMan

  • Guest
Re: avastcmd in crontab
« Reply #2 on: January 16, 2007, 06:54:42 AM »
hi PC,

Yes... The command is executed.
It is the crontab of root.
See attachtment for the strace output.

Kind regards,

Bob

Offline zilog

  • Avast team
  • Advanced Poster
  • *
  • Posts: 957
  • or #f0; daa; add a,#a0; adc a,#40
Re: avastcmd in crontab
« Reply #3 on: January 16, 2007, 09:23:57 AM »
Thanks for the strace output, but there's nothing suspicious - it looks like Your avastcmd did all the job properly, but at the end (right before exit_group(0)) there was no write() called.

Please, could You take the line from Your crontab, and run it manually? This second strace.log should be then compared with the original one. The whole problem seems to be in the final output (bad stdout redirection by the cron environment, try to redirect the output to file) or bad behavior of the engine library when unloaded (try to export LD_ASSUME_KERNEL=2.4.0 to the crontab-environment).

I'm unable to reproduce this bug with avastcmd2.0.1 & engine library 4.so.7.0.0, so please specify more details about this case.

Regards,
PC

May's Law: Software efficiency halves every 18 months, compensating Moore's Law. (David May, INMOS)

DeMan

  • Guest
Re: avastcmd in crontab
« Reply #4 on: January 16, 2007, 12:40:06 PM »
I use OpenNA 2.0 RC2 as distro with kernel 2.6.17.8-1.

I installed libavastengine-4.7.0-i586.tar.gz and avast4server-2.0.0-i586.tar.gz

The libraries files:

lrwxrwxrwx 1 root bin      25 Dec 29 07:49 /usr/lib/libavastengine-4.so.6 -> libavastengine-4.so.7.0.0
lrwxrwxrwx 1 root bin      25 Dec 29 07:45 /usr/lib/libavastengine-4.so.7 -> libavastengine-4.so.7.0.0
-r--r--r-- 1 root bin 1745384 Dec 29 07:45 /usr/lib/libavastengine-4.so.7.0.0
lrwxrwxrwx 1 root bin      25 Dec 29 07:45 /usr/lib/libavastengine.so -> libavastengine-4.so.7.0.0

As attachment I included:

strace command: strace -f >/tmp/avast.log 2>&1 /usr/bin/avastcmd -a -c -i -t A /boot

avast-console.log strace from console
avast-crontab.log strace from crontab
avast-kernel.log strace in bash shell script with export command triggered with crontab

All log files packed in Archive.log. This is a zip file so rename the extention to zip!

Kind regards

Bob

DeMan

  • Guest
Re: avastcmd in crontab
« Reply #5 on: January 18, 2007, 02:01:05 PM »
Hi support,

Any progress or hints?

Kind regards

Bop

Dublin

  • Guest
Re: avastcmd in crontab
« Reply #6 on: January 18, 2007, 04:50:33 PM »
hi,
it's been fixed

DeMan

  • Guest
Re: avastcmd in crontab
« Reply #7 on: January 19, 2007, 07:55:06 AM »
Hi,

OK thanks....

But what's the solution?
Where can I download the fix?

Regards,

Bob