Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2.24, 10.1.39
-
None
Description
Starting from 10.1.39, pre-uninstall scriplet disables mariadb service. But if later the server is reinstalled/upgraded, the post-install service doesn't always enable the service, so it stays disabled.
As a side-effect, mysql alias of the service doesn't work after upgrade, and mysqld alias is not even recognized:
[buildbot@centos73-amd64 ~]$ systemctl status mysql --no-pager
|
● mysql.service - LSB: start and stop MariaDB
|
Loaded: loaded (/etc/rc.d/init.d/mysql; bad; vendor preset: disabled)
|
Active: inactive (dead)
|
Docs: man:systemd-sysv-generator(8)
|
[buildbot@centos73-amd64 ~]$ systemctl status mysqld --no-pager
|
Unit mysqld.service could not be found.
|
|
[buildbot@centos73-amd64 ~]$ sudo systemctl enable mariadb
|
Created symlink from /etc/systemd/system/mysql.service to /usr/lib/systemd/system/mariadb.service.
|
Created symlink from /etc/systemd/system/mysqld.service to /usr/lib/systemd/system/mariadb.service.
|
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
|
[buildbot@centos73-amd64 ~]$ systemctl status mysqld --no-pager
|
● mariadb.service - MariaDB 10.3.15 database server
|
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
|
Drop-In: /etc/systemd/system/mariadb.service.d
|
└─migrated-from-my.cnf-settings.conf, tokudb.conf
|
Active: active (running) since Thu 2019-05-09 21:59:30 UTC; 1h 27min ago
|
Docs: man:mysqld(8)
|
https://mariadb.com/kb/en/library/systemd/
|
Main PID: 3027 (mysqld)
|
Status: "Taking your SQL requests now..."
|
CGroup: /system.slice/mariadb.service
|
└─3027 /usr/sbin/mysqld
|
|
May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [ERROR] mysqld: Server GSSAPI error (major 85...mpty.
|
May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [ERROR] Plugin 'gssapi' init function returned error.
|
May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [Note] Server socket created on IP: '::'.
|
May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [ERROR] Incorrect definition of table mysql.e...'POST
|
May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [ERROR] mysqld: Event Scheduler: An error occ...uler.
|
May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [Note] Reading of all Master_info entries succeded
|
May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [Note] Added new Master_info '' to hash table
|
May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [Note] /usr/sbin/mysqld: ready for connections.
|
May 09 21:59:30 centos73-amd64 mysqld[3027]: Version: '10.3.15-MariaDB' socket: '/var/lib/mysql/mysql.sock' po...erver
|
May 09 21:59:30 centos73-amd64 systemd[1]: Started MariaDB 10.3.15 database server.
|
Hint: Some lines were ellipsized, use -l to show in full.
|
[buildbot@centos73-amd64 ~]$
|
[buildbot@centos73-amd64 ~]$ systemctl status mysql --no-pager
|
● mariadb.service - MariaDB 10.3.15 database server
|
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
|
Drop-In: /etc/systemd/system/mariadb.service.d
|
└─migrated-from-my.cnf-settings.conf, tokudb.conf
|
Active: active (running) since Thu 2019-05-09 21:59:30 UTC; 1h 29min ago
|
Docs: man:mysqld(8)
|
https://mariadb.com/kb/en/library/systemd/
|
Main PID: 3027 (mysqld)
|
Status: "Taking your SQL requests now..."
|
CGroup: /system.slice/mariadb.service
|
└─3027 /usr/sbin/mysqld
|
|
May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [ERROR] mysqld: Server GSSAPI error (major 85...mpty.
|
May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [ERROR] Plugin 'gssapi' init function returned error.
|
May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [Note] Server socket created on IP: '::'.
|
May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [ERROR] Incorrect definition of table mysql.e...'POST
|
May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [ERROR] mysqld: Event Scheduler: An error occ...uler.
|
May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [Note] Reading of all Master_info entries succeded
|
May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [Note] Added new Master_info '' to hash table
|
May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [Note] /usr/sbin/mysqld: ready for connections.
|
May 09 21:59:30 centos73-amd64 mysqld[3027]: Version: '10.3.15-MariaDB' socket: '/var/lib/mysql/mysql.sock' po...erver
|
May 09 21:59:30 centos73-amd64 systemd[1]: Started MariaDB 10.3.15 database server.
|
Hint: Some lines were ellipsized, use -l to show in full.
|
Important note: In order to avoid failures with mysql alias, we will explicitly re-enable the service before using the alias in RPM upgrade tests. It needs to be re-visited after the problem is fixed one or another way.
Attachments
Issue Links
- causes
-
MDEV-21793 The mariadb.service unit not enabled after MDB set up (enabled commands to start at boot)
-
- Confirmed
-
Activity
Field | Original Value | New Value |
---|---|---|
Description |
Starting from 10.1.39, pre-uninstall scriplet disables mariadb service. But if later the server is reinstalled/upgraded, the post-install service doesn't always enable the service, so it stays disabled.
As a side-effect, {{mysql}} alias of the service doesn't work after upgrade. {color:red}Important note: In order to avoid failures with mysql alias, we will explicitly re-enable the service before using the alias in RPM upgrade tests. It needs to be re-visited after the problem is fixed one or another way.{color} |
Starting from 10.1.39, pre-uninstall scriplet disables mariadb service. But if later the server is reinstalled/upgraded, the post-install service doesn't always enable the service, so it stays disabled.
As a side-effect, {{mysql}} alias of the service doesn't work after upgrade, and {{mysqld}} alias is not even recognized: {noformat} [buildbot@centos73-amd64 ~]$ systemctl status mysql --no-pager ● mysql.service - LSB: start and stop MariaDB Loaded: loaded (/etc/rc.d/init.d/mysql; bad; vendor preset: disabled) Active: inactive (dead) Docs: man:systemd-sysv-generator(8) [buildbot@centos73-amd64 ~]$ systemctl status mysqld --no-pager Unit mysqld.service could not be found. [buildbot@centos73-amd64 ~]$ sudo systemctl enable mariadb Created symlink from /etc/systemd/system/mysql.service to /usr/lib/systemd/system/mariadb.service. Created symlink from /etc/systemd/system/mysqld.service to /usr/lib/systemd/system/mariadb.service. Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service. [buildbot@centos73-amd64 ~]$ systemctl status mysqld --no-pager ● mariadb.service - MariaDB 10.3.15 database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) Drop-In: /etc/systemd/system/mariadb.service.d └─migrated-from-my.cnf-settings.conf, tokudb.conf Active: active (running) since Thu 2019-05-09 21:59:30 UTC; 1h 27min ago Docs: man:mysqld(8) https://mariadb.com/kb/en/library/systemd/ Main PID: 3027 (mysqld) Status: "Taking your SQL requests now..." CGroup: /system.slice/mariadb.service └─3027 /usr/sbin/mysqld May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [ERROR] mysqld: Server GSSAPI error (major 85...mpty. May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [ERROR] Plugin 'gssapi' init function returned error. May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [Note] Server socket created on IP: '::'. May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [ERROR] Incorrect definition of table mysql.e...'POST May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [ERROR] mysqld: Event Scheduler: An error occ...uler. May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [Note] Reading of all Master_info entries succeded May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [Note] Added new Master_info '' to hash table May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [Note] /usr/sbin/mysqld: ready for connections. May 09 21:59:30 centos73-amd64 mysqld[3027]: Version: '10.3.15-MariaDB' socket: '/var/lib/mysql/mysql.sock' po...erver May 09 21:59:30 centos73-amd64 systemd[1]: Started MariaDB 10.3.15 database server. Hint: Some lines were ellipsized, use -l to show in full. [buildbot@centos73-amd64 ~]$ [buildbot@centos73-amd64 ~]$ systemctl status mysql --no-pager ● mariadb.service - MariaDB 10.3.15 database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) Drop-In: /etc/systemd/system/mariadb.service.d └─migrated-from-my.cnf-settings.conf, tokudb.conf Active: active (running) since Thu 2019-05-09 21:59:30 UTC; 1h 29min ago Docs: man:mysqld(8) https://mariadb.com/kb/en/library/systemd/ Main PID: 3027 (mysqld) Status: "Taking your SQL requests now..." CGroup: /system.slice/mariadb.service └─3027 /usr/sbin/mysqld May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [ERROR] mysqld: Server GSSAPI error (major 85...mpty. May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [ERROR] Plugin 'gssapi' init function returned error. May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [Note] Server socket created on IP: '::'. May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [ERROR] Incorrect definition of table mysql.e...'POST May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [ERROR] mysqld: Event Scheduler: An error occ...uler. May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [Note] Reading of all Master_info entries succeded May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [Note] Added new Master_info '' to hash table May 09 21:59:30 centos73-amd64 mysqld[3027]: 2019-05-09 21:59:30 0 [Note] /usr/sbin/mysqld: ready for connections. May 09 21:59:30 centos73-amd64 mysqld[3027]: Version: '10.3.15-MariaDB' socket: '/var/lib/mysql/mysql.sock' po...erver May 09 21:59:30 centos73-amd64 systemd[1]: Started MariaDB 10.3.15 database server. Hint: Some lines were ellipsized, use -l to show in full. {noformat} {color:red}Important note: In order to avoid failures with mysql alias, we will explicitly re-enable the service before using the alias in RPM upgrade tests. It needs to be re-visited after the problem is fixed one or another way.{color} |
Status | Open [ 1 ] | In Progress [ 3 ] |
Fix Version/s | 10.1.42 [ 23407 ] | |
Fix Version/s | 10.2.28 [ 23910 ] | |
Fix Version/s | 10.3.19 [ 23908 ] | |
Fix Version/s | 10.4.9 [ 23906 ] | |
Fix Version/s | 10.2 [ 14601 ] | |
Fix Version/s | 10.1 [ 16100 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Progress [ 3 ] | Closed [ 6 ] |
Link | This issue causes MDEV-21793 [ MDEV-21793 ] |
Workflow | MariaDB v3 [ 96647 ] | MariaDB v4 [ 156165 ] |
Fedora recommends to use special macros to deal with systemd: https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/
I doubt we can use them, as we build not only on Fedora. But that's what these macros do on FC29:
/usr/lib/rpm/macros.d/macros.systemd
%systemd_post() \
if [ $1 -eq 1 ] ; then \
# Initial installation \
systemctl --no-reload preset %{?*} &>/dev/null || : \
fi \
%{nil}
%systemd_preun() \
if [ $1 -eq 0 ] ; then \
# Package removal, not upgrade \
systemctl --no-reload disable --now %{?*} &>/dev/null || : \
fi \
%{nil}
%systemd_postun() %{nil}
%systemd_postun_with_restart() \
if [ $1 -ge 1 ] ; then \
# Package upgrade, not uninstall \
systemctl try-restart %{?*} &>/dev/null || : \
fi \
%{nil}
Note that pre-uninstall indeed disables the service. But post-install does preset which enables it again.
I'm leaning towards doing the same, trusting Fedora on this.
Any thoughts? axel? danblack?