I just made the test to be sure: using Wants= does not prevent MySQL to
start event if the system never reaches “time-sync.target”.
I added an ntpdate.service:
# /etc/systemd/system/ntpdate.service
[Unit]
Description=Force synchronisation of time
ConditionPathExists=/etc/default/ntpdate
DefaultDependencies=no
Conflicts=shutdown.target
After=network-online.target
Before=time-sync.target shutdown.target
Wants=network-online.target time-sync.target
[Service]
Type=oneshot
Environment="NTPSERVERS=pool.ntp.org"
EnvironmentFile=/etc/default/ntpdate
ExecStart=/usr/sbin/ntpdate -v $NTPSERVERS
RemainAfterExit=yes
[Install]
WantedBy=sysinit.target
And an override for MySQL:
# /etc/systemd/system/mysql.service.d/override.conf
[Unit]
After=network-online.target time-sync.target
Wants=network-online.target time-sync.target
ntpdate.service is failed:
systemctl status ntpdate.service
● ntpdate.service - Force synchronisation of time
Loaded: loaded (/etc/systemd/system/ntpdate.service; enabled; vendor
preset: enabled)
Active: failed (Result: exit-code) since Mon 2018-10-15 16:51:25 CEST; 40s
ago
Process: 1129 ExecStart=/usr/sbin/ntpdate -v $NTPSERVERS (code=exited,
status=1/FAILURE)
Main PID: 1129 (code=exited, status=1/FAILURE)
But MySQL is started:
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 16:51:27 CEST; 3min 17s ago
Process: 1600 ExecStart=/usr/sbin/mysqld --daemonize
--pid-file=/run/mysqld/mysqld.pid (code=exited, status=0/SUCCESS)
Process: 1550 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre
(code=exited, status=0/SUCCESS)
Main PID: 1602 (mysqld)
Tasks: 30 (limit: 4915)
CGroup: /system.slice/mysql.service
└─1602 /usr/sbin/mysqld --daemonize
--pid-file=/run/mysqld/mysqld.pid
Regards.
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1600164
Title:
Mysql server take 10 minutes to stop without message after time drift
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1600164/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs