Le 02/03/2018 à 11:04, leloft a écrit :
/var/log/clamav/freshclam.log {
      rotate 12
      weekly
      compress
      delaycompress
      missingok
      create 640  clamav adm
      postrotate
      if [ -d /run/systemd/system ]; then
          systemctl -q is-active clamav-freshclam && systemctl kill
--signal=SIGHUP clamav-freshclam || true else
          /etc/init.d/clamav-freshclam reload-log > /dev/null || true
      fi
      endscript
      }


    The section starting at "postrotate" and ending at "endscript" is a script to execute after the "rotation" of the log files. It seems the intention is to send the SIGHUP signal to clamav-freshclam. Clearly, clamav-freshclean needs to be told to re-open its log file when it has been brutally closed by logrotate.

    When the classical RC scripts are installed, the initscript is invoked, rather than directly sending the signal, but, no doubt, it will send the signal.

    Since you haven't systemd installed, you can leave the script as is. If you feel nervous about your script checking for a non-existing file whose name contains the word "systemd", you can remove the conditional logic and keep unconditionnally.

/etc/init.d/clamav-freshclam reload-log > /dev/null || true

        Didier


_______________________________________________
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng

Reply via email to