cannot update freshclam [Solved]

Discussions Regarding Software

Moderator: Moderators

Re: cannot update freshclam

Postby Fitzcarraldo » Sun Apr 17, 2011 17:38

Please mark solved threads as "[Solved]" by clicking on the EDIT button of the first post and appending "[Solved]" to the end of the Subject. I'll do it for you this time.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 8033
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: cannot update freshclam [Solved]

Postby Panuzio » Wed Feb 22, 2012 19:08

For me it isn't solved. :(
Francesco
Ride of Sabayon (Mania) penguins
Gnome is dead!
Gnome 2 forever!

Linux sabayon 4.8.0-sabayon #1 SMP Thu Dec 22 15:22:00 UTC 2016 x86_64 Intel(R) Core(TM) i3 CPU M 350 @ 2.27GHz GenuineIntel GNU/Linux
Panuzio
Advanced Hen
 
Posts: 222
Joined: Mon May 19, 2008 20:04
Location: Firenze, Toscana, Italia (Florence, Tuscany, Italy)

Re: cannot update freshclam [Solved]

Postby Panuzio » Sat Feb 11, 2017 20:13

Panuzio wrote:For me it isn't solved. :(

Code: Select all
# systemctl status clamd
● clamd.service - Generic ClamAV scanner daemon
   Loaded: loaded (/usr/lib64/systemd/system/clamd.service; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since sab 2017-02-11 19:57:27 CET; 15min ago
  Process: 2364 ExecStart=/usr/sbin/clamd -c /etc/clamd%i.conf (code=exited, status=1/FAILURE)

feb 11 19:57:27 sabayon systemd[1]: clamd.service: Unit entered failed state.
feb 11 19:57:27 sabayon systemd[1]: clamd.service: Failed with result 'exit-code'.
feb 11 19:57:27 sabayon clamd[2364]: ERROR: Can't initialize the internal logger
feb 11 19:57:27 sabayon clamd[2364]: ERROR: /var/log/clamav/clamd.log is locked by another process
feb 11 19:57:27 sabayon systemd[1]: clamd.service: Service hold-off time over, scheduling restart.
feb 11 19:57:27 sabayon systemd[1]: Stopped Generic ClamAV scanner daemon.
feb 11 19:57:27 sabayon systemd[1]: clamd.service: Start request repeated too quickly.
feb 11 19:57:27 sabayon systemd[1]: Failed to start Generic ClamAV scanner daemon.
feb 11 19:57:27 sabayon systemd[1]: clamd.service: Unit entered failed state.
feb 11 19:57:27 sabayon systemd[1]: clamd.service: Failed with result 'start-limit'.
Francesco
Ride of Sabayon (Mania) penguins
Gnome is dead!
Gnome 2 forever!

Linux sabayon 4.8.0-sabayon #1 SMP Thu Dec 22 15:22:00 UTC 2016 x86_64 Intel(R) Core(TM) i3 CPU M 350 @ 2.27GHz GenuineIntel GNU/Linux
Panuzio
Advanced Hen
 
Posts: 222
Joined: Mon May 19, 2008 20:04
Location: Firenze, Toscana, Italia (Florence, Tuscany, Italy)

Re: cannot update freshclam [Solved]

Postby Fitzcarraldo » Sun Feb 12, 2017 0:58

@Panuzio: It is due to a different problem. You should have started a fresh topic rather than necro posting.

Anyway, your problem looks to me to be a clamav packaging error in either Sabayon or in Gentoo. You need to do the following:

1. Edit the file /usr/lib64/tmpfiles.d/clamav.conf and change the line in it to be the following:

Code: Select all
d /var/lib/clamav 0710 clamav clamav


2. Create a socket file:

Code: Select all
# touch /var/lib/clamav/clamd.sock
# chown clamav:clamav /var/lib/clamav/clamd.sock


3. Edit the file /etc/clamd.conf and change the LocalSocket line in it to be the following:

Code: Select all
LocalSocket /var/lib/clamav/clamd.sock


4. Make sure every file in /var/lib/clamav/ is owned by clamav, and change the ownership if necessary:

Code: Select all
# ls -la /var/lib/clamav
# chown clamav:clamav /var/lib/clamav/.keep_app-antivirus_clamav-0


5. Stop the service (if it is running) and make sure it is enabled to start the next time the machine is booted:

Code: Select all
# systemctl stop clamd
# systemctl enable clamd


6. Run freshclam to (re-)download the database:

Code: Select all
# freshclam


7. Reboot:

Code: Select all
# reboot


8. Check the service is now running:

Code: Select all
# systemctl status clamd
● clamd.service - Generic ClamAV scanner daemon
   Loaded: loaded (/usr/lib64/systemd/system/clamd.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2017-02-11 23:36:56 GMT; 10min ago
  Process: 2109 ExecStart=/usr/sbin/clamd -c /etc/clamd%i.conf (code=exited, status=0/SUCCESS)
 Main PID: 2320 (clamd)
   CGroup: /system.slice/clamd.service
           └─2320 /usr/sbin/clamd -c /etc/clamd.conf

Feb 11 23:36:04 sabayon.local systemd[1]: Starting Generic ClamAV scanner daemon...
Feb 11 23:36:56 sabayon.local systemd[1]: Started Generic ClamAV scanner daemon.


9. I am not sure if the freshclam service is launched automatically daily by the clamav service (like in some other distributions) or if it has to be enabled manually. Wait a day or two to see if the database files are being updated. If they are not, then try enabling the freshclam service:

Code: Select all
# systemctl enable freshclamd

The files updated by the freshclam daemon are:

/var/lib/clamav/main.cvd
/var/lib/clamav/daily.cld
/var/lib/clamav/bytecode.cvd

freshclam will only update those files if the versions on the ClamAV database server are newer than the files on your machine. So check the date-time stamp of the above files over a few days to see if one or more of them have been updated automatically. If not, enable the freshclamd service manually. But wait and check, don't just go ahead and enable freshclamd today.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 8033
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: cannot update freshclam [Solved]

Postby Panuzio » Sun Feb 12, 2017 18:57

Dear Fitzcarraldo,
First, I thank you for your availability in giving me help - points 1 and 3 was already right -, and I followed all your tips. :)
Code: Select all
ls -la /var/lib/clamav
totale 213764
drwxrwxr-x  2 clamav clamav      4096 12 feb 18.17 .
drwxr-xr-x 55 root   root        4096 11 feb 20.07 ..
-rw-r--r--  1 clamav clamav    524800 26 gen 23.06 bytecode.cld
-rw-r--r--  1 clamav clamav         0 12 feb 18.04 clamd.sock
-rw-r--r--  1 clamav clamav 109197824 12 feb 18.14 daily.cld
-rw-r--r--  1 clamav clamav         0 29 giu  2016 .keep_app-antivirus_clamav-0
-rw-r--r--  1 clamav clamav 109143933 22 gen 04.40 main.cvd
-rw-------  1 clamav clamav       208 12 feb 18.17 mirrors.dat

However, I obtained this reply: :(
Code: Select all
# systemctl status clamd
● clamd.service - Generic ClamAV scanner daemon
   Loaded: loaded (/usr/lib64/systemd/system/clamd.service; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since dom 2017-02-12 18:17:42 CET; 27min ago

feb 12 18:17:41 sabayon systemd[1]: clamd.service: Control process exited, code=exited status=1
feb 12 18:17:41 sabayon systemd[1]: Failed to start Generic ClamAV scanner daemon.
feb 12 18:17:41 sabayon systemd[1]: clamd.service: Unit entered failed state.
feb 12 18:17:41 sabayon systemd[1]: clamd.service: Failed with result 'exit-code'.
feb 12 18:17:42 sabayon systemd[1]: clamd.service: Service hold-off time over, scheduling restart.
feb 12 18:17:42 sabayon systemd[1]: Stopped Generic ClamAV scanner daemon.
feb 12 18:17:42 sabayon systemd[1]: clamd.service: Start request repeated too quickly.
feb 12 18:17:42 sabayon systemd[1]: Failed to start Generic ClamAV scanner daemon.
feb 12 18:17:42 sabayon systemd[1]: clamd.service: Unit entered failed state.
feb 12 18:17:42 sabayon systemd[1]: clamd.service: Failed with result 'start-limit'.
Francesco
Ride of Sabayon (Mania) penguins
Gnome is dead!
Gnome 2 forever!

Linux sabayon 4.8.0-sabayon #1 SMP Thu Dec 22 15:22:00 UTC 2016 x86_64 Intel(R) Core(TM) i3 CPU M 350 @ 2.27GHz GenuineIntel GNU/Linux
Panuzio
Advanced Hen
 
Posts: 222
Joined: Mon May 19, 2008 20:04
Location: Firenze, Toscana, Italia (Florence, Tuscany, Italy)

Re: cannot update freshclam [Solved]

Postby Fitzcarraldo » Mon Feb 13, 2017 0:20

Post the output of the following commands executed as root user:

Code: Select all
# systemctl start clamd
# SYSTEMD_LESS=FRXMK journalctl -xb -n 20
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 8033
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: cannot update freshclam [Solved]

Postby Panuzio » Mon Feb 13, 2017 2:17

These below are the answers.
Code: Select all
# systemctl start clamd
Job for clamd.service failed because the control process exited with error code. See "systemctl status clamd.service" and "journalctl -xe" for details.

Code: Select all
# SYSTEMD_LESS=FRXMK journalctl -xb -n 20
-- Logs begin at dom 2017-01-22 03:56:03 CET, end at lun 2017-02-13 02:07:45 CET. --
feb 13 02:07:45 sabayon clamd[3334]: ERROR: /var/log/clamav/clamd.log is locked by another process
feb 13 02:07:45 sabayon systemd[1]: clamd.service: Control process exited, code=exited status=1
feb 13 02:07:45 sabayon systemd[1]: Failed to start Generic ClamAV scanner daemon.
-- Subject: L'unità clamd.service è fallita
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- L'unità clamd.service è fallita.
--
-- Il risultato è failed.
feb 13 02:07:45 sabayon systemd[1]: clamd.service: Unit entered failed state.
feb 13 02:07:45 sabayon systemd[1]: clamd.service: Failed with result 'exit-code'.
feb 13 02:07:45 sabayon systemd[1]: clamd.service: Service hold-off time over, scheduling restart.
feb 13 02:07:45 sabayon systemd[1]: Stopped Generic ClamAV scanner daemon.
-- Subject: L'unità clamd.service termina la fase di spegnimento
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- L'unità clamd.service ha terminato la fase di spegnimento.
feb 13 02:07:45 sabayon systemd[1]: Starting Generic ClamAV scanner daemon...
-- Subject: L'unità clamd.service inizia la fase di avvio
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- L'unità clamd.service ha iniziato la fase di avvio.
feb 13 02:07:45 sabayon clamd[3338]: ERROR: Can't initialize the internal logger
feb 13 02:07:45 sabayon clamd[3338]: ERROR: /var/log/clamav/clamd.log is locked by another process
feb 13 02:07:45 sabayon systemd[1]: clamd.service: Control process exited, code=exited status=1
feb 13 02:07:45 sabayon systemd[1]: Failed to start Generic ClamAV scanner daemon.
-- Subject: L'unità clamd.service è fallita
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- L'unità clamd.service è fallita.
--
-- Il risultato è failed.
feb 13 02:07:45 sabayon systemd[1]: clamd.service: Unit entered failed state.
feb 13 02:07:45 sabayon systemd[1]: clamd.service: Failed with result 'exit-code'.
feb 13 02:07:45 sabayon systemd[1]: clamd.service: Service hold-off time over, scheduling restart.
feb 13 02:07:45 sabayon systemd[1]: Stopped Generic ClamAV scanner daemon.
-- Subject: L'unità clamd.service termina la fase di spegnimento
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- L'unità clamd.service ha terminato la fase di spegnimento.
feb 13 02:07:45 sabayon systemd[1]: clamd.service: Start request repeated too quickly.
feb 13 02:07:45 sabayon systemd[1]: Failed to start Generic ClamAV scanner daemon.
-- Subject: L'unità clamd.service è fallita
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- L'unità clamd.service è fallita.
--
-- Il risultato è failed.
feb 13 02:07:45 sabayon systemd[1]: clamd.service: Unit entered failed state.
feb 13 02:07:45 sabayon systemd[1]: clamd.service: Failed with result 'start-limit'.

And /var/log/clamav/clamd.log is this.
And another output is this:
Code: Select all
#locate clamd.service
/etc/systemd/system/multi-user.target.wants/clamd.service
/etc/systemd/system/multi-user.target.wants/freshclamd.service
/usr/lib64/systemd/system/clamd.service
/usr/lib64/systemd/system/freshclamd.service
/usr/portage/app-antivirus/clamav/files/clamd.service
/usr/portage/app-antivirus/clamav/files/freshclamd.service
/var/lib/layman/gentoo/app-antivirus/clamav/files/clamd.service
/var/lib/layman/gentoo/app-antivirus/clamav/files/freshclamd.service
Francesco
Ride of Sabayon (Mania) penguins
Gnome is dead!
Gnome 2 forever!

Linux sabayon 4.8.0-sabayon #1 SMP Thu Dec 22 15:22:00 UTC 2016 x86_64 Intel(R) Core(TM) i3 CPU M 350 @ 2.27GHz GenuineIntel GNU/Linux
Panuzio
Advanced Hen
 
Posts: 222
Joined: Mon May 19, 2008 20:04
Location: Firenze, Toscana, Italia (Florence, Tuscany, Italy)

Re: cannot update freshclam [Solved]

Postby Fitzcarraldo » Mon Feb 13, 2017 11:29

Code: Select all
feb 13 02:07:45 sabayon clamd[3338]: ERROR: Can't initialize the internal logger
feb 13 02:07:45 sabayon clamd[3338]: ERROR: /var/log/clamav/clamd.log is locked by another process

Looks like you have another service running when it should not be.

What is the output of the following commands as root user?

Code: Select all
# ps -ef | grep clam | grep -v grep
# systemctl status clamd
# systemctl status freshclamd


Try the following as root user:

Code: Select all
# systemctl stop clamd
# systemctl stop freshclamd
# systemctl disable freshclamd
# systemctl disable clamd
# reboot

Then, after the PC has rebooted:

Code: Select all
# systemctl enable clamd
# reboot
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 8033
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: cannot update freshclam [Solved]

Postby Panuzio » Sat Feb 25, 2017 19:42

Well, I'll try.
Now the output is this one:

Code: Select all
# ps -ef | grep clam | grep -v grep
clamav    2102     1  0 16:10 ?        00:01:37 /usr/sbin/clamd --foreground=true
clamav    2115     1  0 16:10 ?        00:00:00 /usr/bin/freshclam -d -p /run/clamav/freshclam.pid
clamav    3312     1  0 16:15 ?        00:00:12 freshclam --quiet --daemon
clamav    3314     1  0 16:15 ?        00:00:00 freshclam --daemon


# systemctl status clamd
● clamd.service - Generic ClamAV scanner daemon
   Loaded: loaded (/usr/lib64/systemd/system/clamd.service; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since sab 2017-02-25 16:10:20 CET; 3h 14min ago
  Process: 2292 ExecStart=/usr/sbin/clamd -c /etc/clamd%i.conf (code=exited, status=1/FAILURE)

feb 25 16:10:20 sabayon systemd[1]: Failed to start Generic ClamAV scanner daemon.
feb 25 16:10:20 sabayon systemd[1]: clamd.service: Unit entered failed state.
feb 25 16:10:20 sabayon systemd[1]: clamd.service: Failed with result 'exit-code'.
feb 25 16:10:20 sabayon systemd[1]: clamd.service: Service hold-off time over, scheduling restart.
feb 25 16:10:20 sabayon systemd[1]: Stopped Generic ClamAV scanner daemon.
feb 25 16:10:20 sabayon systemd[1]: clamd.service: Start request repeated too quickly.
feb 25 16:10:20 sabayon systemd[1]: Failed to start Generic ClamAV scanner daemon.
feb 25 16:10:20 sabayon systemd[1]: clamd.service: Unit entered failed state.
feb 25 16:10:20 sabayon systemd[1]: clamd.service: Failed with result 'start-limit'.


# systemctl status freshclamd
● freshclamd.service - clamav updater
   Loaded: loaded (/usr/lib64/systemd/system/freshclamd.service; enabled; vendor preset: disabled)
   Active: active (running) since sab 2017-02-25 16:10:11 CET; 3h 15min ago
  Process: 1948 ExecStart=/usr/bin/freshclam -d -p /run/clamav/freshclam.pid (code=exited, status=0/SUCCESS)
 Main PID: 2115 (freshclam)
   CGroup: /system.slice/freshclamd.service
           └─2115 /usr/bin/freshclam -d -p /run/clamav/freshclam.pid

feb 25 16:10:02 sabayon systemd[1]: Starting clamav updater...
feb 25 16:10:11 sabayon systemd[1]: Started clamav updater.
Francesco
Ride of Sabayon (Mania) penguins
Gnome is dead!
Gnome 2 forever!

Linux sabayon 4.8.0-sabayon #1 SMP Thu Dec 22 15:22:00 UTC 2016 x86_64 Intel(R) Core(TM) i3 CPU M 350 @ 2.27GHz GenuineIntel GNU/Linux
Panuzio
Advanced Hen
 
Posts: 222
Joined: Mon May 19, 2008 20:04
Location: Firenze, Toscana, Italia (Florence, Tuscany, Italy)

Re: cannot update freshclam [Solved]

Postby Panuzio » Sat Feb 25, 2017 20:14

Then, the output is this one... :twisted:
Code: Select all
# ps -ef | grep clam | grep -v grep
clamav    1952     1  9 20:03 ?        00:00:31 /usr/sbin/clamd --foreground=true
clamav    2097     1  0 20:03 ?        00:00:00 /usr/bin/freshclam -d --foreground=true


# systemctl status clamd
● clamd.service - Generic ClamAV scanner daemon
   Loaded: loaded (/usr/lib64/systemd/system/clamd.service; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since sab 2017-02-25 20:03:26 CET; 5min ago
  Process: 2301 ExecStart=/usr/sbin/clamd -c /etc/clamd%i.conf (code=exited, status=1/FAILURE)

feb 25 20:03:26 sabayon systemd[1]: Failed to start Generic ClamAV scanner daemon.
feb 25 20:03:26 sabayon systemd[1]: clamd.service: Unit entered failed state.
feb 25 20:03:26 sabayon systemd[1]: clamd.service: Failed with result 'exit-code'.
feb 25 20:03:26 sabayon systemd[1]: clamd.service: Service hold-off time over, scheduling restart.
feb 25 20:03:26 sabayon systemd[1]: Stopped Generic ClamAV scanner daemon.
feb 25 20:03:26 sabayon systemd[1]: clamd.service: Start request repeated too quickly.
feb 25 20:03:26 sabayon systemd[1]: Failed to start Generic ClamAV scanner daemon.
feb 25 20:03:26 sabayon systemd[1]: clamd.service: Unit entered failed state.
feb 25 20:03:26 sabayon systemd[1]: clamd.service: Failed with result 'start-limit'.


# systemctl status freshclamd
● freshclamd.service - clamav updater
   Loaded: loaded (/usr/lib64/systemd/system/freshclamd.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
Francesco
Ride of Sabayon (Mania) penguins
Gnome is dead!
Gnome 2 forever!

Linux sabayon 4.8.0-sabayon #1 SMP Thu Dec 22 15:22:00 UTC 2016 x86_64 Intel(R) Core(TM) i3 CPU M 350 @ 2.27GHz GenuineIntel GNU/Linux
Panuzio
Advanced Hen
 
Posts: 222
Joined: Mon May 19, 2008 20:04
Location: Firenze, Toscana, Italia (Florence, Tuscany, Italy)

PreviousNext

Return to Software in General

Who is online

Users browsing this forum: No registered users and 1 guest