Opened 9 years ago

Closed 5 years ago

#50570 closed defect (fixed)

Installing clamav/clamav-server is very annoying on MacPorts

Reported by: graziosi.angelo@… Owned by: danielluke (Daniel J. Luke)
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: Cc:
Port: clamav clamav-server

Description

On GNU/Linux Mint

sudo apt-get install clamav

is enough to have a working Clamav installation which automatically updates its database (main.cvd etc.)

On MacPorts, one have to install at least two package and manually adjust clamd.conf and freshclam.con as suggested by clamav-server installation,

sudo port install clamav-server
  [...]
  To configure clamd and freshclam look for the following files:
    /opt/local/etc/clamd.conf
    /opt/local/etc/freshclam.conf

If these files do not exist you can copy the sample conf files into place:
    sudo cp /opt/local/etc/clamd.conf.sample /opt/local/etc/clamd.conf
    sudo cp /opt/local/etc/freshclam.conf.sample /opt/local/etc/freshclam.conf

Edit /opt/local/etc/clamd.conf to your liking, example:
# Comment out 'Example' near the top if it exists
    #Example
    LogFile /opt/local/var/log/clamav/clamd.log
    PidFile /opt/local/var/run/clamav/clamd.pid
    LocalSocket /opt/local/var/run/clamav/clamd.socket
    Foreground yes

Edit /opt/local/etc/freshclam.conf to your liking, example:
# Comment out 'Example' near the top if it exists
    #Example
    UpdateLogFile /opt/local/var/log/clamav/freshclam.log
    PidFile /opt/local/var/run/clamav/freshclam.pid
    NotifyClamd /opt/local/etc/clamd.conf

Two launchd startup items have been installed.

To load clamd and freshclam do the following:
    sudo launchctl load -w /Library/LaunchDaemons/org.macports.clamd.plist
    sudo launchctl load -w /Library/LaunchDaemons/org.macports.freshclam.plist

To unload clamd and freshclam do the following:
    sudo launchctl unload -w /Library/LaunchDaemons/org.macports.clamd.plist
    sudo launchctl unload -w /Library/LaunchDaemons/org.macports.freshclam.plist

To try things out do
    sudo freshclam

If all is well you should see your clamav database being updated
  [...]

...otherwise "sudo freshclam" prints ERROR!

But this is not enough!!! One has also to do:

  sudo mkdir -p /opt/local/share/clamav

  sudo chown 82:82 /opt/local/share/clamav
  sudo chmod 755 /opt/local/share/clamav

to avoid other ERRORS!

Now

sudo freshclam

updates the database but will it do the job automatically? Let's see in the next few days..

Why have you created a so annoying port installation? and why two packages? You need only one package which installs ClamAV and setups it so that the database is update automatically

It should be obvious that the installation of an AV should came with a working default installation...

Change History (10)

comment:1 Changed 9 years ago by graziosi.angelo@…

Cc: graziosi.angelo@… added
Last edited 9 years ago by graziosi.angelo@… (previous) (diff)

comment:2 Changed 9 years ago by graziosi.angelo@…

Cc: graziosi.angelo@… removed

Cc Me!

Version 0, edited 9 years ago by graziosi.angelo@… (next)

comment:3 Changed 9 years ago by mf2k (Frank Schima)

Cc: pixilla@… added
Owner: changed from macports-tickets@… to dluke@…
Port: clamav, clamav-serverclamav clamav-server

In the future, please Cc the port maintainers (port info --maintainers clamav clamav-server), if any.

comment:4 Changed 9 years ago by danielluke (Daniel J. Luke)

people may want to install/use clamav without running the server - hence the two ports. I know the port used to install the ${prefix}/share/clamav directory, but I guess an upstream change must have broken that (and I didn't notice it).

comment:5 in reply to:  4 Changed 9 years ago by danielluke (Daniel J. Luke)

Cc: pixilla@… removed
Owner: changed from dluke@… to pixilla@…

Replying to dluke@…:

people may want to install/use clamav without running the server - hence the two ports. I know the port used to install the ${prefix}/share/clamav directory, but I guess an upstream change must have broken that (and I didn't notice it).

This probably belongs in the clamav-server port since it's the one that sets up the clamav user. Pixilla, feel free to add me back if you think something needs to change in the clamav port instead.

comment:6 in reply to:  4 ; Changed 9 years ago by graziosi.angelo@…

Replying to dluke@…:

people may want to install/use clamav without running the server

I don't understand why an user should "install/use clamav without" a mechanism to selfupdate its "vital" database... as occurs on other systems

comment:7 in reply to:  6 ; Changed 9 years ago by danielluke (Daniel J. Luke)

Replying to graziosi.angelo@…:

I don't understand why an user should "install/use clamav without" a mechanism to selfupdate its "vital" database... as occurs on other systems

you may want to update the db via cron (instead of running freshclam) you may be running on a host that only has periodic internet connection.

Also, 'freshclam' running as a daemon doesn't necessarily mean you want 'clamd' running all the time.

In any event, the port you want is 'clamav-server' which if you install also installs the 'clamav' port. So if the clamav-server is updated, you should be happy.

comment:8 in reply to:  7 Changed 9 years ago by graziosi.angelo@…

Replying to dluke@…:

Replying to graziosi.angelo@…:

I don't understand why an user should "install/use clamav without" a mechanism to selfupdate its "vital" database... as occurs on other systems

you may want to update the db via cron (instead of running freshclam) you may be running on a host that only has periodic internet connection.

Also, 'freshclam' running as a daemon doesn't necessarily mean you want 'clamd' running all the time.

In any event, the port you want is 'clamav-server' which if you install also installs the 'clamav' port. So if the clamav-server is updated, you should be happy.

No, I fear that I will not be happy..

On GNU/linux I have installed *only* "clamav" and every time I run manually "sudo freshclam" I find that the database is already updated...

comment:9 Changed 6 years ago by mf2k (Frank Schima)

Owner: changed from pixilla to danielluke
Status: newassigned

See #57827

comment:10 Changed 5 years ago by essandess (Steve Smith)

Resolution: fixed
Status: assignedclosed

In d0f1e462100fc98a1a77d2ac8c1b28530eee46d2/macports-ports (master):

clamav-server: Update Portfile with major upgrade, enhancements, and bugfixes

  • Complete re-write of Portfile
  • Control clamd and freshclam with startupitem, daemondo
  • macOS-specific clamd.conf and freshclam.conf configurations
  • Add Scan-On-Demand bash script with corresponding Finder.app contextual menu item
  • Add Scan-On-Schedule launchdaemon with environment variable control
  • Add Scan-On-Access launchdaemon for ~/Downloads and ~/Desktop directories
  • Volunteer as manintainer

Closes: #58003
Closes: #50570

Note: See TracTickets for help on using tickets.