Project

General

Profile

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

Added by Daniel Dehennin almost 5 years ago. Updated almost 5 years ago.

Status:
Fermé
Priority:
Normal
Assigned To:
Start date:
10/15/2018
Due date:
% Done:

100%

Estimated time:
1.00 h
Remaining (hours):
0.0

Description

Il faut surcharger la configuration systemd du service MySQL afin qu’il démarre après time-sync.target.

Associated revisions

Revision 8de37f60 (diff)
Added by Daniel Dehennin almost 5 years ago

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

Revision 376da523 (diff)
Added by Daniel Dehennin almost 5 years ago

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

Revision 7735ae8e (diff)
Added by Daniel Dehennin almost 5 years ago

The “mysql.service” override is under “/etc/systemd/system/”

Ref: #25565

History

#1 Updated by Daniel Dehennin almost 5 years ago

  • Status changed from Nouveau to En cours
  • Assigned To set to Daniel Dehennin

#2 Updated by Daniel Dehennin almost 5 years ago

  • % Done changed from 0 to 100
  • Remaining (hours) changed from 1.0 to 0.25

#3 Updated by Daniel Dehennin almost 5 years ago

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 Updated by Scrum Master almost 5 years ago

  • Status changed from En cours to Résolu

#5 Updated by Laurent Flori almost 5 years ago

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

Also available in: Atom PDF