Tiny Core Linux

Tiny Core Extensions => TCE Bugs => Topic started by: remus on January 21, 2012, 07:01:44 AM

Title: Problem updating ClamAV
Post by: remus on January 21, 2012, 07:01:44 AM
I was just trying to update clamav with command freshclam

Code: [Select]
$ freshclam
ClamAV update process started at Sat Jan 21 20:54:26 2012
WARNING: DNS record is older than 3 hours.
WARNING: Invalid DNS reply. Falling back to HTTP mode.
Reading CVD header (main.cvd): OK
Downloading main-54.cdiff [100%]
Killed

I'm using:
- tinycore 3.8.4
- ClamAV 0.97.2 (current clamav extension 0.97)

Its worked fine in the past.

The solution I found was to delete
Code: [Select]
daily.cvd
main.cld
mirrors.dat

Next time I run freshclam its ok.

This is documented here : http://forums.cpanel.net/f43/problem-starting-clamav-109321.html (http://forums.cpanel.net/f43/problem-starting-clamav-109321.html)
Title: Re: Problem updating ClamAV
Post by: Jason W on January 24, 2012, 04:59:59 PM
Hey, I remember you had mentioned you would have a try at building an updated clamav.  If not, I can get to it in the next coming days.  An updated build would save a lot of pull on the clamav servers as that main file is about 30MB large if I recall.
Title: Re: Problem updating ClamAV
Post by: remus on January 24, 2012, 05:28:43 PM
Hi Jason W,
I"m not sure if what i've done is correct, I'll try to submit it today so you can have a look at it.

I noticed you had a clamav-dev.tcz extension, will a standard compile of clamav NOT have the dev parts ?
Title: Re: Problem updating ClamAV
Post by: Jason W on January 24, 2012, 07:46:24 PM
A standard compile would have the dev stuff, which is normally separated out.  I will look at your extension when it comes in,

The clamav-dev.tcz extension is only 8kb, which makes almost no sense to separate out.  The dev stuff can be left in at almost no cost in size.
Title: Re: Problem updating ClamAV
Post by: remus on January 24, 2012, 08:48:01 PM
I can't seem to remember to to find the ./configure options

I remember finding an option to specify to put the conf files in /usr/local/etc/clamav else they get put somewhere else by default.

Any tips about how to get that help file up ?

I've tryed
less README
less INSTALL
and had a look at the configure file
Title: Re: Problem updating ClamAV
Post by: martin on January 24, 2012, 08:55:33 PM
Do you mean ./configure --prefix=/usr/local ?
Title: Re: Problem updating ClamAV
Post by: remus on January 24, 2012, 08:59:00 PM
Quote
o you mean ./configure --prefix=/usr/local ?

No that's not it, its a option to specify the location of the clamav conf files (clamd.conf and freshclam.conf)

I found help for it easy with the source's I downloaded at home, but I don't have access to that system right now.

I'm running tinycore on a computer at work.

Theres some way to get a look at all the configure options that clamav will accept, but bugger me I can't find it right now, its like my head is on holiday or the source I just downloaded is not the same as the 0.97.3 I have at home
Title: Re: Problem updating ClamAV
Post by: Rich on January 24, 2012, 09:01:32 PM
Hi remus
Quote
Theres some way to get a look at all the configure options that clamav will accept,
Maybe you want   ./configure --help
Title: Re: Problem updating ClamAV
Post by: martin on January 24, 2012, 09:02:08 PM
Yeah, that's it. Rich only just beat me :)
Title: Re: Problem updating ClamAV
Post by: remus on January 24, 2012, 09:03:19 PM
DOH !!!

I tried it before and it failed
Code: [Select]
$ ./configure --help
chmod: changing permissions of `configure.lineno': Operation not permitted
configure: error: cannot create configure.lineno; rerun with a POSIX shell

It has to be sudo ./configure --help
Thanks guys
Title: Re: Problem updating ClamAV
Post by: remus on January 24, 2012, 11:30:18 PM
Jason W,

My clamav.tcz lacks the following.

- clamav user/group
I think I'd create a start up script for this, can someone give me some pointers.

- comment out the "example" line in freshclam.conf and clamd.conf

I'm about to run out of internet access, and am unsure when I'll get backup online.

Title: Re: Problem updating ClamAV
Post by: Jason W on January 24, 2012, 11:35:32 PM
Here is the source dir for clamav, clamav is the /usr/local/tce.installed startup script, it creates the clamav user/group.  Running the script with compiletc.tcz installed should pretty much just make it happen.
Title: Re: Problem updating ClamAV
Post by: remus on January 25, 2012, 03:03:22 AM
Sorry, but I don't see a link...

... Ok found your file, am importing.
Title: Re: Problem updating ClamAV
Post by: remus on January 25, 2012, 06:33:56 AM
While testing I got the following error.

Code: [Select]
$ tce-load -i clamav.tcz
adduser: invalid option -- 'H'
usage: adduser  [-u uid [-o]] [-g group] [-G group,...]
                [-d home] [-s shell] [-c comment] [-m [-k template]]
                [-f inactive] [-e expire mm/dd/yy] [-p passwd] [-n] [-r] name
       adduser  -D [-g group] [-b base] [-s shell] [-f inactive] [-e expire mm/dd/yy]
clamav.tcz: OK

code from /usr/local/tce.installed/clamav
Code: [Select]
#!/bin/sh

adduser -DH clamav

[ -d /usr/local/etc/clamav ] || mkdir /usr/local/etc/clamav

[ -f /usr/local/etc/clamav/clamd.conf ] || cp -p /usr/local/share/clamav/files/clamd.conf /usr/loc
al/etc/clamav/

[ -f /usr/local/etc/clamav/freshclam.conf ] || cp -p /usr/local/share/clamav/files/freshclam.conf
/usr/local/etc/clamav/

should the command "adduser -DH clamav" be changed to "adduser -Dh clamav" ?
Title: Re: Problem updating ClamAV
Post by: Rich on January 25, 2012, 09:05:01 AM
Hi remus
I suspect that clamav wants to be in its own user and group, so maybe it should have been  g
Title: Re: Problem updating ClamAV
Post by: Jason W on January 25, 2012, 03:31:33 PM
adduser from busybox has the option "H" to not create home directory.

I think that using "busybox adduser" will keep it from causing an error if another adduser from an extension is installed.
Title: Re: Problem updating ClamAV
Post by: remus on January 25, 2012, 07:55:34 PM
sounds right, I have shadowutils installed so that I could follow the 'samba by example' book command by command. This installed the useradd and groupadd commands used in the samba book.

test results from the command line using a test user called clam
$ busybox adduser -DH clam
error need sudo

$ sudo busybox adduser -DH clam
worked, I get a clam user in /etc/passwd, and clam group in /etc/group

Should I use the sudo prefix for a start up script or is it done for me transparently ?

Question.
Is
Code: [Select]
[ condition ] || command_to_executeSome kind of shell scripting short hand for an if/else ?
Title: Re: Problem updating ClamAV
Post by: Rich on January 25, 2012, 08:08:16 PM
Hi remus
This site makes for a pretty good quick reference:
http://ss64.com/nt/syntax-conditional.html (http://ss64.com/nt/syntax-conditional.html)
Title: Re: Problem updating ClamAV
Post by: remus on January 25, 2012, 08:21:41 PM
thx rich,
crystal clear, and useful short hand.
Title: Re: Problem updating ClamAV
Post by: Jason W on January 25, 2012, 11:55:38 PM
/usr/local/tce.installed startup scripts are run as root, no need for sudo.
Title: Re: Problem updating ClamAV
Post by: remus on January 26, 2012, 02:14:29 AM
Jason W,

I won't be able to upload clamav.tcz to you until monday, until then, i'm rationing my last 13mb of online access at home.

If you want to take care of it sooner I'll take care of the next one ;)

Also, my current clamav.tcz for 0.97.2 has contaminated permissions/ownership for
/usr/local/etc/clamav/clamd.conf and freshclam.conf, so I'm not sure how to set them.

would you use root.root + 640 ?
Title: Re: Problem updating ClamAV
Post by: Jason W on January 26, 2012, 05:14:03 AM
I don't mind waiting, Monday is good.

I will look at the perms thing.
Title: Re: Problem updating ClamAV
Post by: remus on January 26, 2012, 06:03:44 AM
Did you hear about inflation ?
Eggs are going up.
This should surprise a few chickens...
Title: Re: Problem updating ClamAV
Post by: remus on January 27, 2012, 06:52:37 AM
submitqc4 complains about the clamav.tcz.info file

Looks ok to me, here it is.
Code: [Select]
current:        2012/01/30 Updated to 0.97.3
Title: Re: Problem updating ClamAV
Post by: Jason W on January 27, 2012, 07:22:11 AM
Current: needs a capital C or it will make an error.
Title: Re: Problem updating ClamAV
Post by: remus on January 29, 2012, 01:37:50 AM
Jason W,
Got my internet account topped up a day early, i'm ready to upload clamav 0.97.3 as soon as you can get me the ownership/perms you use for

/usr/local/etc/clamav/clamd.conf
/usr/local/etc/clamav/freshclam.conf

/usr/local/share/clamav/files/clamd.conf
/usr/local/share/clamav/files/freshclam.conf

I could just download clamav 0.97.2 and have a look myself... however I'm trying to make my online access stretch.
Title: Re: Problem updating ClamAV
Post by: Jason W on February 02, 2012, 07:39:14 PM
clamav.tcz updated.  Thanks