Project

General

Profile

Scénario #31672

logrotate - Duplicate log entry declaration

Added by mathieu carrolle over 3 years ago. Updated about 3 years ago.

Status:
Terminé (Sprint)
Priority:
Normal
Assigned To:
Category:
-
Start date:
02/22/2021
Due date:
03/12/2021
% Done:

100%

Story points:
1.0
Remaining (hours):
0.00 hour
Velocity based estimate:
Release:
Release relationship:
Auto

Description

Sur une nouvelle installation eolebase, le service logrotate est en erreur car plusieurs déclarations de fichier de log sont en double dans le fichier generated_local_rules et les fichiers specifiques au service (e.g. squid_rsyslog).

Pour corriger, j'ai supprimé les entrées dans le fichier generated_local-rules. Je joins un diff du fichier generated_local_rules et la sortie du service logrotate

Diff:

4,5d3
< /var/log/rsyslog/local/auth/auth.*.log
< /var/log/rsyslog/local/bastion/bastion.*.log
9,10d6
< /var/log/rsyslog/local/creoled/creoled.*.log
< /var/log/rsyslog/local/cron/cron.*.log
12d7
< /var/log/rsyslog/local/e2guardian/e2guardian0.*.log
19d13
< /var/log/rsyslog/local/exim/exim.*.log
24,25d17
< /var/log/rsyslog/local/kernel/kernel.*.log
< /var/log/rsyslog/local/login/login.*.log
29,30d20
< /var/log/rsyslog/local/ntpd/ntpd.*.log
< /var/log/rsyslog/local/rsyslog/rsyslog.*.log
32,33d21
< /var/log/rsyslog/local/squid/squid1.*.log
< /var/log/rsyslog/local/squid/squid4.*.log
36,37d23
< /var/log/rsyslog/local/sshd/sshd.*.log
< /var/log/rsyslog/local/su/su.*.log
47,49c33
< /var/log/rsyslog/local/winbindd/winbindd.*.log
< /var/log/rsyslog/local/zephiragents/zephiragents.*.log
< /var/log/rsyslog/local/zephir/zephir.log {
---
> /var/log/rsyslog/local/winbindd/winbindd.*.log {

Log d'erreur du service logcheck.

logrotate[69063]: error: squid_rsyslog:1 duplicate log entry for /var/log/rsyslog/local/squid/squid1.info.log
logrotate[69063]: error: squid_rsyslog:18 duplicate log entry for /var/log/rsyslog/local/squid/squid4.notice.log
logrotate[69063]: error: found error in file squid_rsyslog, skipping
logrotate[69063]: error: zephir-stats:10 duplicate log entry for /var/log/rsyslog/local/zephir/zephir.log
logrotate[69063]: error: zephir-stats:10 duplicate log entry for /var/log/rsyslog/local/zephiragents/zephiragents.alert.log
logrotate[69063]: error: found error in file zephir-stats, skipping

Eolebase: 2.8


Subtasks

Tâche #31730: Rétablir l’assignation de la variable LOGROTATED_DIRFerméBenjamin Bohard


Related issues

Related to Distribution EOLE - Tâche #31742: Valider le scénario logrotate - Duplicate log entry declaration Fermé 02/24/2021
Related to Distribution EOLE - Tâche #32150: /var/log/rsyslog/local/creoled/creoled.info.log (à nouveau ?) en double dans logrotate Fermé 04/16/2021

History

#1 Updated by Daniel Dehennin over 3 years ago

  • Assigned To set to Daniel Dehennin

Bonjour.

Sur un serveur 2.8.0 fraîchement installé, configuré et instancié, le fichier /etc/logrotate.d/generated_local_rules est vide :

root@eolebase:~# cat /etc/logrotate.d/generated_local_rules 
# Rules automatically generated

Ce fichier est généré par le script /usr/share/eole/posttemplate/00-eole-common lors de la reconfiguration d’un serveur.

Les modifications manuelles de ce fichier seront écrasées lors du prochain reconfigure du serveur.

Pouvez-vous décrire votre environnement ? Quels services avez-vous installé et activé sur votre eolebase 2.8.0 ?

#2 Updated by mathieu carrolle over 3 years ago

Bonjour,

Sur ce serveur (module eolebase), les services eole-sso et eole-proxy ont été installés et activés.

#3 Updated by Daniel Dehennin over 3 years ago

J’ai reproduit le problème :

  1. aca.eolebase-2.8.0-instance-default
  2. apt-eole install eole-sso eole-proxy
  3. gen_config pour activer les deux services
  4. reconfigure
root@eolebase:~# systemctl status logrotate.service 
● logrotate.service - Rotate log files
     Loaded: loaded (/lib/systemd/system/logrotate.service; static; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2021-02-11 14:40:06 CET; 16min ago
TriggeredBy: ● logrotate.timer
       Docs: man:logrotate(8)
             man:logrotate.conf(5)
    Process: 13523 ExecStart=/usr/sbin/logrotate /etc/logrotate.conf (code=exited, status=1/FAILURE)
   Main PID: 13523 (code=exited, status=1/FAILURE)

févr. 11 14:40:06 eolebase logrotate[13523]: error: rsyslog:60 duplicate log entry for /var/log/rsyslog/local/kernel/kernel.debug.log
févr. 11 14:40:06 eolebase logrotate[13523]: error: rsyslog:65 duplicate log entry for /var/log/rsyslog/local/rsyslog/rsyslog.info.log
févr. 11 14:40:06 eolebase logrotate[13523]: error: rsyslog:109 duplicate log entry for /var/log/rsyslog/local/ntpd/ntpd.info.log
févr. 11 14:40:06 eolebase logrotate[13523]: error: found error in file rsyslog, skipping
févr. 11 14:40:06 eolebase logrotate[13523]: error: zephir-stats:10 duplicate log entry for /var/log/rsyslog/local/zephir/zephir.log
févr. 11 14:40:06 eolebase logrotate[13523]: error: zephir-stats:10 duplicate log entry for /var/log/rsyslog/local/zephiragents/zephiragents.info.log
févr. 11 14:40:06 eolebase logrotate[13523]: error: found error in file zephir-stats, skipping
févr. 11 14:40:06 eolebase systemd[1]: logrotate.service: Main process exited, code=exited, status=1/FAILURE
févr. 11 14:40:06 eolebase systemd[1]: logrotate.service: Failed with result 'exit-code'.
févr. 11 14:40:06 eolebase systemd[1]: Failed to start Rotate log files.

Il semble y avoir un soucis dans la détection de la prise en charge des fichiers de configuration

root@eolebase:~# rgrep -F /var/log/rsyslog/local/kernel/ /etc/logrotate*
/etc/logrotate.d/generated_local_rules:/var/log/rsyslog/local/kernel/kernel.*.log
/etc/logrotate.d/rsyslog:/var/log/rsyslog/local/kernel/*.log {
root@eolebase:~# rgrep -F /var/log/rsyslog/local/rsyslog/ /etc/logrotate*
/etc/logrotate.d/generated_local_rules:/var/log/rsyslog/local/rsyslog/rsyslog.*.log
/etc/logrotate.d/rsyslog:/var/log/rsyslog/local/rsyslog/*.log {
root@eolebase:~# rgrep -F /var/log/rsyslog/local/ntpd/ /etc/logrotate*
/etc/logrotate.d/generated_local_rules:/var/log/rsyslog/local/ntpd/ntpd.*.log
/etc/logrotate.d/rsyslog:/var/log/rsyslog/local/ntpd/*.log {
root@eolebase:~# rgrep -F /var/log/rsyslog/local/zephir/ /etc/logrotate*
/etc/logrotate.d/zephir-stats:/var/log/rsyslog/local/zephir/zephir*.log
/etc/logrotate.d/generated_local_rules:/var/log/rsyslog/local/zephir/zephir.log {
root@eolebase:~# rgrep -F /var/log/rsyslog/local/zephiragents/ /etc/logrotate*
/etc/logrotate.d/zephir-stats:/var/log/rsyslog/local/zephiragents/zephiragents*.log {
/etc/logrotate.d/generated_local_rules:/var/log/rsyslog/local/zephiragents/zephiragents.*.log

#4 Updated by Gilles Grandgérard over 3 years ago

  • Tracker changed from Demande to Scénario
  • Start date deleted (02/10/2021)
  • Release set to EOLE 2.8.0
  • Story points set to 1.0

#5 Updated by Gilles Grandgérard over 3 years ago

  • Due date set to 03/12/2021
  • Target version set to sprint 2021 08-10 Equipe MENSR
  • Start date set to 02/22/2021

#6 Updated by Joël Cuissinat over 3 years ago

  • Target version changed from sprint 2021 08-10 Equipe MENSR to Prestation Cadoles MEN 08-10

#7 Updated by Joël Cuissinat over 3 years ago

  • Assigned To deleted (Daniel Dehennin)

#8 Updated by Benjamin Bohard about 3 years ago

  • Assigned To set to Benjamin Bohard

#9 Updated by Joël Cuissinat about 3 years ago

  • Related to Tâche #31742: Valider le scénario logrotate - Duplicate log entry declaration added

#10 Updated by Benjamin Bohard about 3 years ago

  • Status changed from Nouveau to Résolu

#11 Updated by Joël Cuissinat about 3 years ago

Test avec le paquet eole-server 2.8.0-38 :

root@eolebase:~# systemctl status logrotate.service 
● logrotate.service - Rotate log files
     Loaded: loaded (/lib/systemd/system/logrotate.service; static; vendor preset: enabled)
     Active: inactive (dead) since Thu 2021-02-25 16:35:36 CET; 8min ago
TriggeredBy: ● logrotate.timer
       Docs: man:logrotate(8)
             man:logrotate.conf(5)
   Main PID: 1611 (code=exited, status=0/SUCCESS)

févr. 25 16:35:36 eolebase systemd[1]: Starting Rotate log files...
févr. 25 16:35:36 eolebase systemd[1]: logrotate.service: Succeeded.
févr. 25 16:35:36 eolebase systemd[1]: Finished Rotate log files.

Les 5 rgrep proposés ne donnent chacun qu'une seule réponse.

#12 Updated by Joël Cuissinat about 3 years ago

  • Status changed from Résolu to Terminé (Sprint)

#13 Updated by Joël Cuissinat about 3 years ago

  • Related to Tâche #32150: /var/log/rsyslog/local/creoled/creoled.info.log (à nouveau ?) en double dans logrotate added

Also available in: Atom PDF