Tâche #25565
Scénario #25457: La gestion de la mise à l’heure du serveur doit être fonctionnelle sur 2.7.0
Le service MySQL doit démarrer après que l’heure soit synchronisée
Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
Début:
15/10/2018
Echéance:
% réalisé:
100%
Temps estimé:
1.00 h
Restant à faire (heures):
0.0
Description
Il faut surcharger la configuration systemd du service MySQL afin qu’il démarre après time-sync.target
.
Révisions associées
MySQL must start only when time is synchronised
- systemd/mysql.service.d/override.conf: start after
“network-online.target” and “time-sync.target”
- eole-mysql.mk: install systemd unit override file.
Ref: #25565
Package “mysql.service” override in “eole-mysql-pkg”
- debian/eole-mysql.install: specify the installation of
/etc/logrotate.d/ to avoid packaging the systemd override file.
- debian/eole-mysql-pkg.install: install the systemd unit override
file.
- debian/eole-mysql-pkg.postinst: reload the systemd configuration.
Ref: #25565
The “mysql.service” override is under “/etc/systemd/system/”
Ref: #25565
Historique
#1 Mis à jour par Daniel Dehennin il y a plus de 5 ans
- Statut changé de Nouveau à En cours
- Assigné à mis à Daniel Dehennin
#2 Mis à jour par Daniel Dehennin il y a plus de 5 ans
- % réalisé changé de 0 à 100
- Restant à faire (heures) changé de 1.0 à 0.25
#3 Mis à jour par Daniel Dehennin il y a plus de 5 ans
Pour tester¶
Le service mysql.service
doit avoir une surcharge de configuration active¶
systemctl cat mysql.service # /lib/systemd/system/mysql.service # MySQL systemd service file [Unit] Description=MySQL Community Server After=network.target [Install] WantedBy=multi-user.target [Service] Type=forking User=mysql Group=mysql PIDFile=/run/mysqld/mysqld.pid PermissionsStartOnly=true ExecStartPre=/usr/share/mysql/mysql-systemd-start pre ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid TimeoutSec=600 Restart=on-failure RuntimeDirectory=mysqld RuntimeDirectoryMode=755 LimitNOFILE=5000 # /etc/systemd/system/mysql.service.d/override.conf [Unit] After=network-online.target time-sync.target Wants=network-online.target time-sync.target
Le service mysql.service
doit être démarré¶
systemctl status mysql.service ● mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Drop-In: /etc/systemd/system/mysql.service.d └─override.conf Active: active (running) since Mon 2018-10-15 17:02:13 CEST; 11min ago Process: 1570 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid (code=exited, status=0/SUCCESS) Process: 1528 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS) Main PID: 1572 (mysqld) Tasks: 31 (limit: 4915) CGroup: /system.slice/mysql.service └─1572 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid oct. 15 17:02:11 scribe systemd[1]: Starting MySQL Community Server... oct. 15 17:02:13 scribe systemd[1]: Started MySQL Community Server.
Le démarrage doit se faire après que ntpdate.service
soit terminé, c’est à dire après time-sync.target
¶
Voir l’image boot.svg
dans le scénario #25457.
#4 Mis à jour par Scrum Master il y a plus de 5 ans
- Statut changé de En cours à Résolu
#5 Mis à jour par Laurent Flori il y a plus de 5 ans
- Statut changé de Résolu à Fermé
- Restant à faire (heures) changé de 0.25 à 0.0