Project

General

Profile

Tâche #16858

Distribution EOLE - Scénario #16962: Traitement express MEN (36-38)

Horus 2.5.2 : l'utilisateur bareos reste connecté a mysql

Added by Anthony RAULT over 6 years ago. Updated over 6 years ago.

Status:
Fermé
Priority:
Normal
Assigned To:
Start date:
08/09/2016
Due date:
% Done:

100%

Estimated time:
2.00 h
Spent time:
Remaining (hours):
0.0

Description

version EOLE: 2.5.2
module: Horus

Bonjour,
l'erreur dans le log bareos est:
Fatal error: Could not open Catalog "MyCatalog", database "bareos".

le problème vient du script d’arrêt/démarrage /etc/init.d/bareos-dir (package bareos-director). Il n'attends pas l’arrêt de mysqld avant son arrêt.
l'erreur se site a la ligne 7:
Should-Stop: postgresql mysq bareos-sd bareos-fd
qui devrait être:
Should-Stop: postgresql mysql bareos-sd bareos-fd

Cordialement

Associated revisions

Revision 2491e54d (diff)
Added by Daniel Dehennin over 6 years ago

Le script d’init ne référence pas « mysql »

  • debian/bareos-director.bareos-dir.init.in: Correction du
    « Should-Stop » : « mysq » → « mysql ».

Ref: #16858

History

#1 Updated by Gérald Schwartzmann over 6 years ago

  • Subject changed from utilisateur bareos reste connecté a mysql to Horus 2.5.2 : l'utilisateur bareos reste connecté a mysql

#2 Updated by Daniel Dehennin over 6 years ago

  • Assigned To set to Daniel Dehennin

#3 Updated by Daniel Dehennin over 6 years ago

  • Estimated time set to 2.00 h
  • Parent task set to #16962

#4 Updated by Daniel Dehennin over 6 years ago

  • % Done changed from 0 to 10
  • Remaining (hours) set to 1.0

J’ai corrigé le script d’init mais j’avoue que la description de la demande me laisse assez perplexe pour faire les tests :

  • Les lignes de log dont vous parlez ne sont présentes que dans /var/log/bareos/bareos.log, qui n’est créé qu’avant l’instance ;
  • Comment reproduire et voir le fait que l’utilisateur bareos reste connecté à MySQL ?

#5 Updated by Anthony RAULT over 6 years ago

Bonjour,

Le log se situe en /var/log/rsyslog/local/bareos-dir/bareos-dir.err.log

l'erreur de l'utilisateur restant connecté as été vu sur tous les serveurs avec des configuration Bareos avec mysql.

Pour vérifier:
Instancier un Horus, configurer les 3 sauvegardes total, différentiel et incrémentiel. Laissez mijoté et lancez la commande:

#!/bin/bash
function calCode
{
    mdp=''
    local var1=''
    local var2=''
    local rne=$(echo $1 | tr '[:lower:]' '[:upper:]')
    local alfabet="ABCDEFGHJKLMNPRSTUVWXYZ" 
    local hexa="ABCDEF1234567890" 
    local c1=${alfabet:$((${rne:0:4}%23)):1}
    local c2=${alfabet:$((${rne:0:5}%23)):1}
    local c3=${alfabet:$((${rne:0:6}%23)):1}
    local code="$c3$c2$c1$c3$c2$c1$c3$c2" 
    for i in {0..7}; do
        var1=$(printf "%d" "'${rne:$i:1}")
        var2=$(printf "%d" "'${code:$i:1}")
        mdp=$mdp${hexa:$(((var1 ^ var2)%15)):1}
    done
}

calCode ${rne}
mysql -u MenInst -p${mdp} -se "SHOW FULL PROCESSLIST;" 

Ce script provient d'une personne qui s'occupe de GFC.

#6 Updated by Scrum Master over 6 years ago

  • Status changed from Nouveau to En cours

#7 Updated by Daniel Dehennin over 6 years ago

  • Configuration des sauvegardes
    root@horus:~# bareosconfig.py -d
    Support : {u'usb_path': u'/dev/sdb1', u'support_type': u'usb'}
    Mail : {u'mail_error': [], u'mail_ok': []}
    Programmation : 
        1 : Sauvegarde totale dans la première nuit du mois du dimanche au lundi à 21:00
        2 : Sauvegarde différentielle dans la nuit du samedi au dimanche à 21:00
        3 : Sauvegarde incrémentale de la nuit du lundi au mardi à la nuit du vendredi au samedi à 21:00
    
  • Reset du mot de passe root MySQL
    root@horus:~# mysql_pwd.py bidule
    ## Réinitialisation des mots de passe Mysql ##
    
  • Liste des connexions à MySQL
    root@horus:~# mysql -u root -p -se "SHOW FULL PROCESSLIST;" 
    Enter password: 
    Id    User    Host    db    Command    Time    State    Info
    24    bareos    localhost    bareos    Sleep    1722        NULL
    69    root    localhost    NULL    Query    0    NULL    SHOW FULL PROCESSLIST
    

Le fait que bareos reste connecté à MySQL semble être le fonctionnement normal du service, il doit se déconnecter à l’arrêt.

Pour ma part, avec la version 14.2.1+20141017-2-8 de bareos, je n’ai pas de message d’erreur Fatal error: Could not open Catalog "MyCatalog", database "bareos" :

2016-09-22T10:22:47.941952+02:00 horus.etb1.lan bareos-dir: horus-dir JobId 3: shell command: run AfterJob "sudo /usr/share/eole/sbin/bareosmount.py --umount" 
2016-09-22T10:22:48.219179+02:00 horus.etb1.lan bareos-dir: horus-dir JobId 3: AfterJob: Démontage OK
2016-09-22T10:22:48.222758+02:00 horus.etb1.lan bareos-dir: horus-dir JobId 3: shell command: run AfterJob "/usr/lib/bareos/scripts/delete_catalog_backup" 
2016-09-22T10:22:48.237274+02:00 horus.etb1.lan bareos-dir: horus-dir JobId 3: shell command: run AfterJob "sudo /usr/share/eole/sbin/bareosconfig.py --unlock --daemon=horus-dir --jobID=3 --backup_ok --jobType=catalogue" 
2016-09-22T10:31:06.463369+02:00 horus.etb1.lan bareos-dir: Shutting down BAREOS service: horus-dir ...

#8 Updated by Daniel Dehennin over 6 years ago

  • % Done changed from 10 to 100
  • Remaining (hours) changed from 1.0 to 0.0

#9 Updated by Daniel Dehennin over 6 years ago

  • Status changed from En cours to Résolu

#10 Updated by Emmanuel GARETTE over 6 years ago

  • Status changed from Résolu to Fermé

Ok :

root@scribe:~# grep mysq /etc/init.d/bareos-dir 
# Should-Start:      postgresql mysql bareos-sd bareos-fd
# Should-Stop:       postgresql mysql bareos-sd bareos-fd
root@scribe:~# 

Also available in: Atom PDF