LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Installing File::Scan::ClamAV on Ubuntu 14.04 LTS keeps failing (https://www.linuxquestions.org/questions/linux-software-2/installing-file-scan-clamav-on-ubuntu-14-04-lts-keeps-failing-4175511692/)

Toadman 07-20-2014 04:58 PM

Installing File::Scan::ClamAV on Ubuntu 14.04 LTS keeps failing
 
Not sure if this is the correct forum, but I'll give it a try. I'm attempting to install the above perl module that interfaces Spamassassin with ClamAV and keep getting errors in testing:

Code:

chris@localhost:~$ sudo -s
[sudo] password for chris:
root@localhost:~# perl -MCPAN -e shell
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v2.00)
Enter 'h' for help.

cpan[1]> install File::Scan::ClamAV


 CPAN.pm: Building J/JA/JAMTUR/File-Scan-ClamAV-1.91.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for File::Scan::ClamAV
Writing MYMETA.yml and MYMETA.json
cp lib/File/Scan/ClamAV.pm blib/lib/File/Scan/ClamAV.pm
Manifying blib/man3/File::Scan::ClamAV.3pm
  JAMTUR/File-Scan-ClamAV-1.91.tar.gz
  /usr/bin/make -- OK
'YAML' not installed, will not store persistent state
Running make test
PERL_DL_NONLAZY=1 CLAMD_PATH=/usr/sbin /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00basic.t ....... ok 
t/01ping.t ........ 1/3 # Failed test 2 in t/01ping.t at line 26
#  t/01ping.t line 26 is: ok($av->ping);
t/01ping.t ........ Failed 1/3 subtests
t/02reload.t ...... 1/3 # Failed test 2 in t/02reload.t at line 25
#  t/02reload.t line 25 is: ok($av->reload);
t/02reload.t ...... Failed 1/3 subtests
t/03quit.t ........ 1/4 # Failed test 2 in t/03quit.t at line 31
#  t/03quit.t line 31 is: ok($av->quit);
t/03quit.t ........ 3/4 ERROR: LOCAL: Socket file /root/.cpan/build/File-Scan-ClamAV-1.91-_962_7/clamsock could not be bound: Permission denied
t/03quit.t ........ Failed 1/4 subtests
t/04scan.t ........ 1/8 # Test 4 got: "" (t/04scan.t at line 36)
#  Expected: "1" (Didn't detect /root/.cpan/build/File-Scan-ClamAV-1.91-_962_7/testfiles/clamavtest)
#  t/04scan.t line 36 is: ok(exists($results{"$testdir/clamavtest"}), 1, "Didn't detect $testdir/clamavtest");
# Test 5 got: "" (t/04scan.t at line 37)
#  Expected: "1" (Didn't detect /root/.cpan/build/File-Scan-ClamAV-1.91-_962_7/testfiles/clamavtest.zip)
#  t/04scan.t line 37 is: ok(exists($results{"$testdir/clamavtest.zip"}), 1, "Didn't detect $testdir/clamavtest.zip");
# Test 6 got: "" (t/04scan.t at line 38)
#  Expected: "1" (Didn't detect /root/.cpan/build/File-Scan-ClamAV-1.91-_962_7/testfiles/clamavtest.gz)
#  t/04scan.t line 38 is: ok(exists($results{"$testdir/clamavtest.gz"}), 1, "Didn't detect $testdir/clamavtest.gz");
t/04scan.t ........ Failed 3/8 subtests
t/05streamscan.t .. 1/8 # Test 5 got: <UNDEF> (t/05streamscan.t at line 43)
#  Expected: "FOUND"
#  t/05streamscan.t line 43 is: ok($ans, 'FOUND');
# Test 6 got: <UNDEF> (t/05streamscan.t at line 44)
#  Expected: "ClamAV-Test-Signature"
#  t/05streamscan.t line 44 is: ok($vir, 'ClamAV-Test-Signature');
t/05streamscan.t .. Failed 2/8 subtests
t/pod-coverage.t .. ok 
t/pod.t ........... ok 

Test Summary Report
-------------------
t/01ping.t      (Wstat: 0 Tests: 3 Failed: 1)
  Failed test:  2
t/02reload.t    (Wstat: 0 Tests: 3 Failed: 1)
  Failed test:  2
t/03quit.t      (Wstat: 0 Tests: 4 Failed: 1)
  Failed test:  2
t/04scan.t      (Wstat: 0 Tests: 8 Failed: 3)
  Failed tests:  4-6
t/05streamscan.t (Wstat: 0 Tests: 8 Failed: 2)
  Failed tests:  5-6
Files=8, Tests=29, 53 wallclock secs ( 0.04 usr  0.01 sys + 49.99 cusr  2.21 csys = 52.25 CPU)
Result: FAIL
Failed 5/8 test programs. 8/29 subtests failed.
make: *** [test_dynamic] Error 255
  JAMTUR/File-Scan-ClamAV-1.91.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports JAMTUR/File-Scan-ClamAV-1.91.tar.gz
Running make install
  make test had returned bad status, won't install without force
Failed during this command:
 JAMTUR/File-Scan-ClamAV-1.91.tar.gz          : make_test NO

cpan[2]> exit
Terminal does not support GetHistory.
Lockfile removed.

Output of any SA process. In this case I just ran sa-learn --dump magic, errors noted below:
chris@localhost:~$ sa-learn --dump magic
plugin: failed to parse plugin /etc/spamassassin/clamav.pm: Can't locate File/Scan/ClamAV.pm in @INC (you may need to install the File::Scan::ClamAV module) (@INC contains: lib /usr/share/perl5 /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl) at /etc/spamassassin/clamav.pm line 14.
BEGIN failed--compilation aborted at /etc/spamassassin/clamav.pm line 14.
Compilation failed in require at /usr/share/perl5/Mail/SpamAssassin/PluginHandler.pm line 109.

Anyone with any ideas on what to do? I tried to find the module in the Ubuntu repositories but couldn't.

Thanks for any advice/assistance
Chris

smallpond 07-21-2014 09:53 AM

The first error is pretty basic. This test fails:
Code:

ok($av->ping);
That means it can't do ping so your network is broken.

Toadman 07-21-2014 11:49 AM

Network is up else I would not be able to reply correct?

smallpond 07-21-2014 12:34 PM

I didn't say it wasn't up; I said it was broken. This works on any box correctly connected to the internet:

ping 8.8.8.8

Toadman 07-21-2014 12:36 PM

chris@localhost:~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=50 time=30.5 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=50 time=30.7 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=50 time=30.9 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=50 time=30.9 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=50 time=30.5 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=50 time=30.5 ms
64 bytes from 8.8.8.8: icmp_seq=7 ttl=50 time=30.8 ms
64 bytes from 8.8.8.8: icmp_seq=8 ttl=50 time=30.6 ms
64 bytes from 8.8.8.8: icmp_seq=9 ttl=50 time=30.5 ms
64 bytes from 8.8.8.8: icmp_seq=10 ttl=50 time=30.4 ms
64 bytes from 8.8.8.8: icmp_seq=11 ttl=50 time=30.5 ms
64 bytes from 8.8.8.8: icmp_seq=12 ttl=50 time=30.9 ms
64 bytes from 8.8.8.8: icmp_seq=13 ttl=50 time=31.0 ms
64 bytes from 8.8.8.8: icmp_seq=14 ttl=50 time=30.6 ms
^C
--- 8.8.8.8 ping statistics ---
14 packets transmitted, 14 received, 0% packet loss, time 13016ms
rtt min/avg/max/mdev = 30.438/30.710/31.056/0.270 ms
chris@localhost:~$

smallpond 07-21-2014 01:14 PM

And yet ping failed in the test code. Have a look in t/ping.t and see what it's trying to do.

smallpond 07-21-2014 03:20 PM

I looked at the test and it is not doing ping; I was misled by the name. It is checking to see if the test can talk to the Clam daemon after it starts it. Evidently it can't. That may be due to running in the CPAN shell. Maybe try installing from the command line:

Code:

perl -MCPAN -e 'install File::Scan::ClamAV'

Toadman 07-21-2014 03:51 PM

I'm not a programmer so here goes my guess:

# start clamd
my $pid = fork;
die "Fork failed" unless defined $pid;
if (!$pid) {
exec "$ENV{CLAMD_PATH}/clamd -c clamav.conf";
die "clamd failed to start: $!";

Clamd is located in /usr/sbin clamav.conf is located in /etc/clamav/clamav.conf the clamd.pid file is located in /var/run/clamav

the rest of ping.t is:

}
for (1..10) {
last if (-e "clamsock");
if (kill(0 => $pid) == 0) {
die "clamd appears to have died";
}
sleep(1);
}

my $av = new File::Scan::ClamAV(port => "clamsock");
ok($av);
ok($av->ping);

ok(kill(9 => $pid), 1);
1 while (waitpid($pid, &WNOHANG) != -1);
unlink("clamsock");

Toadman 07-21-2014 04:11 PM

Hmm, looks like the same errors

Code:

chris@localhost:~$ sudo -s
[sudo] password for chris:
root@localhost:~# perl -MCPAN -e 'install File::Scan::ClamAV'
Reading '/home/chris/.cpan/Metadata'
  Database was generated on Mon, 21 Jul 2014 17:53:02 GMT
Running install for module 'File::Scan::ClamAV'
Running make for J/JA/JAMTUR/File-Scan-ClamAV-1.91.tar.gz
Checksum for /home/chris/.cpan/sources/authors/id/J/JA/JAMTUR/File-Scan-ClamAV-1.91.tar.gz ok

  CPAN.pm: Building J/JA/JAMTUR/File-Scan-ClamAV-1.91.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for File::Scan::ClamAV
Writing MYMETA.yml and MYMETA.json
cp lib/File/Scan/ClamAV.pm blib/lib/File/Scan/ClamAV.pm
Manifying blib/man3/File::Scan::ClamAV.3pm
  JAMTUR/File-Scan-ClamAV-1.91.tar.gz
  /usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 CLAMD_PATH=/usr/sbin /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00basic.t ....... ok 
t/01ping.t ........ 1/3 # Failed test 2 in t/01ping.t at line 26
#  t/01ping.t line 26 is: ok($av->ping);
t/01ping.t ........ Failed 1/3 subtests
t/02reload.t ...... 1/3 # Failed test 2 in t/02reload.t at line 25
#  t/02reload.t line 25 is: ok($av->reload);
t/02reload.t ...... Failed 1/3 subtests
t/03quit.t ........ 1/4 # Failed test 2 in t/03quit.t at line 31
#  t/03quit.t line 31 is: ok($av->quit);
t/03quit.t ........ 3/4 ERROR: LOCAL: Socket file /home/chris/.cpan/build/File-Scan-ClamAV-1.91-qMlSN_/clamsock could not be bound: Permission denied
t/03quit.t ........ Failed 1/4 subtests
t/04scan.t ........ 2/8 # Test 4 got: "" (t/04scan.t at line 36)
#  Expected: "1" (Didn't detect /home/chris/.cpan/build/File-Scan-ClamAV-1.91-qMlSN_/testfiles/clamavtest)
#  t/04scan.t line 36 is: ok(exists($results{"$testdir/clamavtest"}), 1, "Didn't detect $testdir/clamavtest");
# Test 5 got: "" (t/04scan.t at line 37)
#  Expected: "1" (Didn't detect /home/chris/.cpan/build/File-Scan-ClamAV-1.91-qMlSN_/testfiles/clamavtest.zip)
#  t/04scan.t line 37 is: ok(exists($results{"$testdir/clamavtest.zip"}), 1, "Didn't detect $testdir/clamavtest.zip");
# Test 6 got: "" (t/04scan.t at line 38)
#  Expected: "1" (Didn't detect /home/chris/.cpan/build/File-Scan-ClamAV-1.91-qMlSN_/testfiles/clamavtest.gz)
#  t/04scan.t line 38 is: ok(exists($results{"$testdir/clamavtest.gz"}), 1, "Didn't detect $testdir/clamavtest.gz");
t/04scan.t ........ Failed 3/8 subtests
t/05streamscan.t .. 1/8 # Test 5 got: <UNDEF> (t/05streamscan.t at line 43)
#  Expected: "FOUND"
#  t/05streamscan.t line 43 is: ok($ans, 'FOUND');
# Test 6 got: <UNDEF> (t/05streamscan.t at line 44)
#  Expected: "ClamAV-Test-Signature"
#  t/05streamscan.t line 44 is: ok($vir, 'ClamAV-Test-Signature');
t/05streamscan.t .. Failed 2/8 subtests
t/pod-coverage.t .. ok 
t/pod.t ........... ok 

Test Summary Report
-------------------
t/01ping.t      (Wstat: 0 Tests: 3 Failed: 1)
  Failed test:  2
t/02reload.t    (Wstat: 0 Tests: 3 Failed: 1)
  Failed test:  2
t/03quit.t      (Wstat: 0 Tests: 4 Failed: 1)
  Failed test:  2
t/04scan.t      (Wstat: 0 Tests: 8 Failed: 3)
  Failed tests:  4-6
t/05streamscan.t (Wstat: 0 Tests: 8 Failed: 2)
  Failed tests:  5-6
Files=8, Tests=29, 61 wallclock secs ( 0.04 usr  0.01 sys + 38.97 cusr  2.86 csys = 41.88 CPU)
Result: FAIL
Failed 5/8 test programs. 8/29 subtests failed.
make: *** [test_dynamic] Error 255
  JAMTUR/File-Scan-ClamAV-1.91.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports JAMTUR/File-Scan-ClamAV-1.91.tar.gz
Running make install
  make test had returned bad status, won't install without force
root@localhost:~#

Doing this as 'sudo' should work shouldn't it? On the old Mandriva box I used to always su - to root to do things such as this.

Toadman 07-21-2014 05:22 PM

Possibly an issue, in Ubuntu the start-up script for clamd is in /etc/init.d and is called 'clamav-daemon' which to start you service clamav-daemon start on my old Mandriva box the start-up script was in /etc/rc.d/init.d/clamd possibly that is confusing the module install?


All times are GMT -5. The time now is 03:15 AM.