MooK
By:
MooK

clamav-daemon fails to load due to memory; any way to run clamscan on demand for attachments?

February 11, 2015 6.4k views

Hi,

I'm using a 512MB Debian droplet, and I currently have about 280MB free:

total used free shared buffers cached
Mem: 497 209 287 0 1 84

When I run clamav-daemon, I end up with this error:

tail -f /var/log/clamav/clamav.log
Wed Feb 11 01:31:00 2015 -> clamd daemon 0.98.5 (OS: linux-gnu, ARCH: x86_64, CPU: x86_64)
Wed Feb 11 01:31:00 2015 -> Log file size limited to 10485760bytes.
Wed Feb 11 01:31:00 2015 -> Reading databases from /var/lib/clamav
Wed Feb 11 01:31:00 2015 -> Not loading PUA signatures.
Wed Feb 11 01:31:00 2015 -> Bytecode: Security mode set to "TrustSigned".
Wed Feb 11 01:31:10 2015 -> Loaded 3741717 signatures.
Wed Feb 11 01:31:11 2015 -> LOCAL: Unix socket file /tmp/clamd.socket
Wed Feb 11 01:31:11 2015 -> LOCAL: Setting connection queue length to 30
Wed Feb 11 01:31:11 2015 -> ERROR: daemonize() failed: Cannot allocate memory
Wed Feb 11 01:31:11 2015 -> Socket file removed.

As a result, I'm guessing my droplet just isn't powerful enough to have clamav running as a daemon all the time. So, I would prefer to have it scan on demand, once per day, and scan each attachment as it comes in. I plan to use exim4. Is this possible?

1 Answer
by Justin Ellingwood
Swap space can be used as an "overflow" area for your system when you run out of RAM. The operating system can store data that would normally be kept in RAM on the hard drive in a specially formatted file. In this guide, we'll demonstrate how to create and use one of these files in Ubuntu 14.04.
  • Thanks again, vps.

    [ ok ] Starting ClamAV daemon: clamd .

    total used free shared buffers cached
    Mem: 497 317 179 0 0 14
    Swap: 1023 145 878
Have another answer? Share your knowledge.