Автор Тема: Clamav не обновляет сигнатуры автоматом  (Прочитано 11890 раз)

Оффлайн ∞lan∞

  • Завсегдатай
  • *
  • Сообщений: 328
Приходится вручную запускать freshclam
$ systemctl status clamd
● clamd.service - LSB: Start clamd at boot time
   Loaded: loaded (/etc/rc.d/init.d/clamd; generated)
   Active: active (running) since Mon 2018-12-31 22:40:54 +07; 48min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1149 ExecStart=/etc/rc.d/init.d/clamd start (code=exited, status=0/SUCCESS)
 Main PID: 1366 (clamd)
    Tasks: 2 (limit: 4035)
   CGroup: /system.slice/clamd.service
           └─1366 /usr/sbin/clamd

дек 31 22:40:54 a888.localdomain clamd[1149]: Starting clamd service: [ DONE ]
дек 31 22:40:54 a888.localdomain systemd[1]: Started LSB: Start clamd at boot time.
дек 31 22:50:51 a888.localdomain clamd[1366]: SelfCheck: Database status OK.
дек 31 22:50:51 a888.localdomain clamd[1366]: fds_poll_recv: timeout after 600 seconds
дек 31 23:00:51 a888.localdomain clamd[1366]: SelfCheck: Database status OK.
дек 31 23:00:51 a888.localdomain clamd[1366]: fds_poll_recv: timeout after 600 seconds
дек 31 23:10:51 a888.localdomain clamd[1366]: SelfCheck: Database status OK.
дек 31 23:10:51 a888.localdomain clamd[1366]: fds_poll_recv: timeout after 600 seconds
дек 31 23:20:51 a888.localdomain clamd[1366]: SelfCheck: Database status OK.
дек 31 23:20:51 a888.localdomain clamd[1366]: fds_poll_recv: timeout after 600 seconds

Онлайн asy

  • alt linux team
  • ***
  • Сообщений: 8 099
Сервис clamd тут не при чём. Собственно, как и вообще systemctl. freshclam должен запускаться кроном: /etc/cron.d/freshclam, по крайней мере, в p8.

Оффлайн Speccyfighter

  • Мастер
  • ***
  • Сообщений: 10 259
Приходится вручную запускать freshclam

Это у вас в системе на systemd, но не в системе на sysvinit:
$ rpm -qpvl ./clamav-freshclam-0.100.2-alt0.M80P.2.i586.rpm | grep cron
-rw-r--r--    1 root    root               68 дек 11 20:49 /etc/cron.d/freshclam
$ apt-cache depends clamav-freshclam | grep cron
  Требует: </etc/cron.d>
    vixie-cron-4.1.20060426-alt10
$ rpm -q --scripts vixie-cron | grep post_
/usr/sbin/post_service crond
$ sed -n '29,30p' /usr/sbin/post_service
        if [ "$RPM_INSTALL_ARG1" -eq 1 ]; then
                chkconfig --add "$1"
$ grep '\# chkc' /etc/rc.d/init.d/crond
# chkconfig: 2345 40 60

SpecTips/triggers: 3 Определение типа операции с пакетом
« Последнее редактирование: 02.01.2019 05:58:49 от Speccyfighter »

Оффлайн ∞lan∞

  • Завсегдатай
  • *
  • Сообщений: 328
Приходится вручную запускать freshclam

Это у вас в системе на systemd, но не в системе на sysvinit:
В симпли фрешклам кронится, но почему-то в матэ нет.
« Последнее редактирование: 05.01.2019 18:12:02 от ∞lan∞ »

Онлайн asy

  • alt linux team
  • ***
  • Сообщений: 8 099
В симпли фрешклам кронится, но почему-то в матэ нет.
Работа cron никак не должна зависеть от DE. А что в /var/log/cron/info, или в его аналоге от systemd?
« Последнее редактирование: 08.01.2019 10:43:40 от asy »

Оффлайн sb

  • Модератор глобальный
  • *****
  • Сообщений: 8 991
Платформа какая или какой конкретно дистрибутив ставили ? В ваших сообщениях нет этой информации.

Оффлайн ∞lan∞

  • Завсегдатай
  • *
  • Сообщений: 328
Я не утверждаю, что дело в DE.
/etc/clamav/freshclam.conf как в симпли так и в матэ одинаков.

##
## Please read the freshclam.conf(5) manual before editing this file.
##

# Path to the database directory.
# WARNING: It must match clamd.conf's directive!
# Default: hardcoded (depends on installation options)
DatabaseDirectory /var/lib/clamav

# Path to the log file (make sure it has proper permissions)
# Default: disabled
UpdateLogFile /var/log/clamav/freshclam.log

# Maximum size of the log file.
# Value of 0 disables the limit.
# You may use 'M' or 'm' for megabytes (1M = 1m = 1048576 bytes)
# and 'K' or 'k' for kilobytes (1K = 1k = 1024 bytes).
# in bytes just don't use modifiers. If LogFileMaxSize is enabled,
# log rotation (the LogRotate option) will always be enabled.
# Default: 1M
LogFileMaxSize 0

# Log time with each message.
# Default: no
LogTime yes

# Enable verbose logging.
# Default: no
LogVerbose yes

# Use system logger (can work together with UpdateLogFile).
# Default: no
LogSyslog yes

# Specify the type of syslog messages - please refer to 'man syslog'
# for facility names.
# Default: LOG_LOCAL6
LogFacility LOG_MAIL

# Enable log rotation. Always enabled when LogFileMaxSize is enabled.
# Default: no
#LogRotate yes

# This option allows you to save the process identifier of the daemon
# Default: disabled
PidFile /var/run/clamav/freshclam.pid

# By default when started freshclam drops privileges and switches to the
# "clamav" user. This directive allows you to change the database owner.
# Default: clamav (may depend on installation options)
DatabaseOwner mail

# Use DNS to verify virus database version. Freshclam uses DNS TXT records
# to verify database and software versions. With this directive you can change
# the database verification domain.
# WARNING: Do not touch it unless you're configuring freshclam to use your
# own database verification domain.
# Default: current.cvd.clamav.net
#DNSDatabaseInfo current.cvd.clamav.net

# database.clamav.net is now the primary domain name to be used world-wide.
# Now that CloudFlare is being used as our Content Delivery Network (CDN),
# this one domain name works world-wide to direct freshclam to the closest
# geographic endpoint.
DatabaseMirror database.clamav.net

# How many attempts to make before giving up.
# Default: 3 (per mirror)
#MaxAttempts 5

# With this option you can control scripted updates. It's highly recommended
# to keep it enabled.
# Default: yes
#ScriptedUpdates yes

# By default freshclam will keep the local databases (.cld) uncompressed to
# make their handling faster. With this option you can enable the compression;
# the change will take effect with the next database update.
# Default: no
#CompressLocalDatabase no

# With this option you can provide custom sources (http:// or file://) for
# database files. This option can be used multiple times.
# Default: no custom URLs
#DatabaseCustomURL http://myserver.com/mysigs.ndb
#DatabaseCustomURL file:///mnt/nfs/local.hdb

# This option allows you to easily point freshclam to private mirrors.
# If PrivateMirror is set, freshclam does not attempt to use DNS
# to determine whether its databases are out-of-date, instead it will
# use the If-Modified-Since request or directly check the headers of the
# remote database files. For each database, freshclam first attempts
# to download the CLD file. If that fails, it tries to download the
# CVD file. This option overrides DatabaseMirror, DNSDatabaseInfo
# and ScriptedUpdates. It can be used multiple times to provide
# fall-back mirrors.
# Default: disabled
#PrivateMirror mirror1.mynetwork.com
#PrivateMirror mirror2.mynetwork.com

# Number of database checks per day.
# Default: 12 (every two hours)
#Checks 24

# Proxy settings
# Default: disabled
#HTTPProxyServer proxy
#HTTPProxyPort 3128
#HTTPProxyUsername myusername
#HTTPProxyPassword mypass

# If your servers are behind a firewall/proxy which applies User-Agent
# filtering you can use this option to force the use of a different
# User-Agent header.
# Default: clamav/version_number
#HTTPUserAgent SomeUserAgentIdString

# Use aaa.bbb.ccc.ddd as client address for downloading databases. Useful for
# multi-homed systems.
# Default: Use OS'es default outgoing IP address.
#LocalIPAddress aaa.bbb.ccc.ddd

# Send the RELOAD command to clamd.
# Default: no
NotifyClamd /etc/clamav/clamd.conf

# Run command after successful database update.
# Default: disabled
#OnUpdateExecute command

# Run command when database update process fails.
# Default: disabled
#OnErrorExecute command

# Run command when freshclam reports outdated version.
# In the command string %v will be replaced by the new version number.
# Default: disabled
#OnOutdatedExecute command

# Don't fork into background.
# Default: no
#Foreground yes

# Enable debug messages in libclamav.
# Default: no
Debug yes

# Timeout in seconds when connecting to database server.
# Default: 30
#ConnectTimeout 60

# Timeout in seconds when reading from database server.
# Default: 30
#ReceiveTimeout 60

# With this option enabled, freshclam will attempt to load new
# databases into memory to make sure they are properly handled
# by libclamav before replacing the old ones.
# Default: yes
TestDatabases yes

# This option enables support for Google Safe Browsing. When activated for
# the first time, freshclam will download a new database file
# (safebrowsing.cvd) which will be automatically loaded by clamd and
# clamscan during the next reload, provided that the heuristic phishing
# detection is turned on. This database includes information about websites
# that may be phishing sites or possible sources of malware. When using this
# option, it's mandatory to run freshclam at least every 30 minutes.
# Freshclam uses the ClamAV's mirror infrastructure to distribute the
# database and its updates but all the contents are provided under Google's
# terms of use. See https://www.google.com/transparencyreport/safebrowsing
# and https://www.clamav.net/documents/safebrowsing
# for more information.
# Default: disabled
SafeBrowsing yes

# This option enables downloading of bytecode.cvd, which includes additional
# detection mechanisms and improvements to the ClamAV engine.
# Default: enabled
Bytecode yes

# Download an additional 3rd party signature database distributed through
# the ClamAV mirrors.
# This option can be used multiple times.
#ExtraDatabase dbname1
#ExtraDatabase dbname2

# rpm -qa | grep -i clam
clamav-0.100.2-alt0.M80P.2
libclamav7-0.100.2-alt0.M80P.2
alterator-clamav-1.1.1-alt1
clamav-freshclam-0.100.2-alt0.M80P.2
clamsmtp-1.10-alt2.qa1

alt-workstation-8.2-x86_64.iso
alt-simply-8.2.0-live-x86_64.iso

$ inxi -S
System:    Kernel: 4.9.147-std-def-alt0.M80P.1 x86_64 (64 bit)
           Desktop: MATE 1.12.1  Distro: ALT Workstation 8.2

« Последнее редактирование: 08.01.2019 11:14:44 от ∞lan∞ »

Онлайн asy

  • alt linux team
  • ***
  • Сообщений: 8 099
Я не утверждаю, что дело в DE.
/etc/clamav/freshclam.conf как в симпли так и в матэ одинаков.
Речь про /etc/cron.d/freshclam и про лог cron в плане его запуска, а не про его конфиг пока. Если руками запускается, то freshclam.conf рабочий и не интересен  особо.

В логе /var/log/cron/info должно быть что-то вроде
crond[4805]: (root) CMD (   /usr/bin/freshclam --quiet --daemon-notify)
« Последнее редактирование: 08.01.2019 11:23:19 от asy »

Оффлайн ∞lan∞

  • Завсегдатай
  • *
  • Сообщений: 328
В логе /var/log/cron/info должно быть что-то вроде
crond[4805]: (root) CMD (   /usr/bin/freshclam --quiet --daemon-notify)
Да я бы сразу показал если б было что.
# ls -l /var/log/cron
итого 0
-rw-r----- 1 root adm 0 дек 25  2017 errors
-rw-r----- 1 root adm 0 дек 25  2017 info
-rw-r----- 1 root adm 0 дек 25  2017 warnings

Онлайн asy

  • alt linux team
  • ***
  • Сообщений: 8 099
Ну значит journalctl <как-то-там>. Я systemd не использую. Но лог должен быть. :-)

UPD: а сам cron есть? Его на что-то systemd-шное не поменяли случайно? ps ax|grep cron что показывает?
« Последнее редактирование: 08.01.2019 11:40:39 от asy »

Оффлайн ∞lan∞

  • Завсегдатай
  • *
  • Сообщений: 328
# journalctl -a | egrep -i "freshclam|cron" >> journal.txt

# ps ax|grep cron
15739 pts/0    S+     0:00 grep --color=auto cron

# rpm -qa | grep -i vixi
vixie-cron-4.1.20060426-alt10

$ clamscan --version
ClamAV 0.100.2/25257/Tue Jan  1 05:19:42 2019
« Последнее редактирование: 08.01.2019 11:45:42 от ∞lan∞ »

Онлайн asy

  • alt linux team
  • ***
  • Сообщений: 8 099
# ps ax|grep cron
15739 pts/0    S+     0:00 grep --color=auto cron

# rpm -qa | grep -i vixi
vixie-cron-4.1.20060426-alt10
Ну вот. cron есть, но по какой-то причине не запущен.

Оффлайн ∞lan∞

  • Завсегдатай
  • *
  • Сообщений: 328
# ps ax|grep cron
15739 pts/0    S+     0:00 grep --color=auto cron

# rpm -qa | grep -i vixi
vixie-cron-4.1.20060426-alt10
Ну вот. cron есть, но по какой-то причине не запущен.
т.е. надо так? ¬

# /etc/init.d/crond start
# systemctl start crond
# /sbin/chkconfig crond on

Оффлайн ∞lan∞

  • Завсегдатай
  • *
  • Сообщений: 328
# systemctl start crondпосле запустился freshclam.

Онлайн asy

  • alt linux team
  • ***
  • Сообщений: 8 099
т.е. надо так? ¬
В p8 расчёт на запущенный cron. В Сизифе сейчас unit-файлы, в общем-то, случайно появились, убирать я их не стал, но там в clamav-freshclam.service напсано ConditionPathExists=!/etc/cron.d/clamav-freshclam. cron.d/freshclam я переименую в следующей сборке в Сизифе в cron.d/clamav-freshclam, чтобы соответствовало, но вот как это разруливать в рамках одного пакета пока не знаю. То есть, расчёт по умолчанию тоже будет на cron в таком раскладе, включить запуск посредством systemd можно будет удалением clamav-freshclam, но файл при обновлении пакета восстановится.
« Последнее редактирование: 08.01.2019 12:44:50 от asy »