Project

General

Profile

Tâche #34002

Scénario #33848: Pb logrotate winbindd

Tester

Added by Benjamin Bohard over 1 year ago. Updated over 1 year ago.

Status:
Fermé
Priority:
Normal
Assigned To:
Start date:
03/28/2022
Due date:
% Done:

100%

Remaining (hours):
0.0

History

#1 Updated by Benjamin Bohard over 1 year ago

Le changement à tester est le fonctionnement du nouveau script /usr/sbin/eole-purge-logs :
  • il doit être installé
  • son exécution ne doit pas provoquer d’erreurs
  • il doit être exécuté au reconfigure

Pour que le script ait des choses à faire, il faut des fichiers de log non compressés avec de multiples timestamps à la fin du nom.
Ces fichiers doivent se trouver sous /var/log.

Il y a plusieurs sous-cas pris en compte :
  • le fichier est vide
  • le fichier n’est pas vide :
    • l’un des timestamp composant le nom peut-être utilisé pour renommer le fichier
    • aucun des timestamp composent le nom ne peut-être utilisé pour renommer le fichier

Par exemple :

/var/log/samba/log.winbindd                              # log en cours d’écriture
/var/log/samba/log.winbindd-20220401.gz
/var/log/samba/log.winbindd-20220402.gz
/var/log/samba/log.winbindd-20220404                     # précédent log écrit, compression différée à la prochaine rotation
/var/log/samba/log.winbindd-20220401-20220402            # fichier vide avec nom défectueux, à supprimer
/var/log/samba/log.winbindd-20220401-20220402-20220404   # fichier non vide ne pouvant pas être renommé (des fichiers existent déjà avec les noms potentiels)
/var/log/samba/log.winbindd-20220401-20220402-20220403   # fichier non vide pouvant être renommé en log.winbindd-20220403

#2 Updated by Ludwig Seys over 1 year ago

  • Status changed from Nouveau to En cours
  • Assigned To set to Ludwig Seys

#3 Updated by Ludwig Seys over 1 year ago

  • Status changed from En cours to Résolu
  • % Done changed from 0 to 100

test concluant
nb : ne pas oublier de remplir les fichier de logs pour le test, et surtout qu'il y en a un qui doit rester vide.

#4 Updated by Joël Cuissinat over 1 year ago

root@eolebase:~# ll /var/log/samba/
total 32
drwxr-xr-x  2 root root   4096 avril 11 14:46 ./
drwxrwxr-x 19 root syslog 4096 avril 11 14:45 ../
-rw-r--r--  1 root root      5 avril 11 14:45 log.winbindd
-rw-r--r--  1 root root      0 avril 11 14:46 log.winbindd-20220401-20220402
-rw-r--r--  1 root root      3 avril 11 14:46 log.winbindd-20220401-20220402-20220403
-rw-r--r--  1 root root      3 avril 11 14:46 log.winbindd-20220401-20220402-20220404
-rw-r--r--  1 root root     75 avril 11 14:47 log.winbindd-20220401.gz
-rw-r--r--  1 root root     89 avril 11 14:47 log.winbindd-20220402.gz
-rw-r--r--  1 root root      5 avril 11 14:46 log.winbindd-20220404
run-parts: executing /usr/share/eole/posttemplate/00-eole-common reconfigure
Purge log files with non-conventional names
Erased files:
     /var/log/samba/log.winbindd-20220401-20220402
Renamed files:
     /var/log/samba/log.winbindd-20220401-20220402-20220403 to /var/log/samba/log.winbindd-20220403
Untouched files:
     /var/log/samba/log.winbindd-20220401-20220402-20220404
root@eolebase:~# ll /var/log/samba/
total 32
drwxr-xr-x  2 root root   4096 avril 11 14:48 ./
drwxrwxr-x 19 root syslog 4096 avril 11 14:45 ../
-rw-r--r--  1 root root      5 avril 11 14:45 log.winbindd
-rw-r--r--  1 root root      3 avril 11 14:46 log.winbindd-20220401-20220402-20220404
-rw-r--r--  1 root root     75 avril 11 14:47 log.winbindd-20220401.gz
-rw-r--r--  1 root root     89 avril 11 14:47 log.winbindd-20220402.gz
-rw-r--r--  1 root root      3 avril 11 14:46 log.winbindd-20220403
-rw-r--r--  1 root root      5 avril 11 14:46 log.winbindd-20220404

#5 Updated by Joël Cuissinat over 1 year ago

  • Status changed from Résolu to Fermé
  • Remaining (hours) set to 0.0

Also available in: Atom PDF