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.
- causes
-
MDEV-21793
The mariadb.service unit not enabled after MDB set up (enabled commands to start at boot)
-
-
Confirmed
{"report":{"fcp":1604.6999998092651,"ttfb":346.6000003814697,"pageVisibility":"visible","entityId":75945,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":32,"apdex":0.5,"journeyId":"af078729-f98a-45b7-adc2-c3e84e51cb3a","navigationType":0,"readyForUser":1693.1999998092651,"redirectCount":0,"resourceLoadedEnd":1187.8000001907349,"resourceLoadedStart":357.69999980926514,"resourceTiming":[{"duration":142.70000076293945,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":357.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":357.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":500.4000005722046,"responseStart":0,"secureConnectionStart":0},{"duration":142.69999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":358.1000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":358.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":500.80000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":570.1999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":358.30000019073486,"connectEnd":505.5,"connectStart":505.5,"domainLookupEnd":505.5,"domainLookupStart":505.5,"fetchStart":358.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":506.69999980926514,"responseEnd":928.5,"responseStart":533.6999998092651,"secureConnectionStart":505.5},{"duration":729.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":359.30000019073486,"connectEnd":359.30000019073486,"connectStart":359.30000019073486,"domainLookupEnd":359.30000019073486,"domainLookupStart":359.30000019073486,"fetchStart":359.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":507,"responseEnd":1088.8000001907349,"responseStart":531.6999998092651,"secureConnectionStart":359.30000019073486},{"duration":176,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":360.19999980926514,"connectEnd":360.19999980926514,"connectStart":360.19999980926514,"domainLookupEnd":360.19999980926514,"domainLookupStart":360.19999980926514,"fetchStart":360.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":507.19999980926514,"responseEnd":536.1999998092651,"responseStart":528.5,"secureConnectionStart":360.19999980926514},{"duration":200.60000038146973,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":360.69999980926514,"connectEnd":360.69999980926514,"connectStart":360.69999980926514,"domainLookupEnd":360.69999980926514,"domainLookupStart":360.69999980926514,"fetchStart":360.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":510.5,"responseEnd":561.3000001907349,"responseStart":548.6000003814697,"secureConnectionStart":360.69999980926514},{"duration":199.39999961853027,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":362.6000003814697,"connectEnd":362.6000003814697,"connectStart":362.6000003814697,"domainLookupEnd":362.6000003814697,"domainLookupStart":362.6000003814697,"fetchStart":362.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":511,"responseEnd":562,"responseStart":550.5,"secureConnectionStart":362.6000003814697},{"duration":147.60000038146973,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":362.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":362.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":510.4000005722046,"responseStart":0,"secureConnectionStart":0},{"duration":200.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":362.9000005722046,"connectEnd":362.9000005722046,"connectStart":362.9000005722046,"domainLookupEnd":362.9000005722046,"domainLookupStart":362.9000005722046,"fetchStart":362.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":511.19999980926514,"responseEnd":563.1000003814697,"responseStart":552.6000003814697,"secureConnectionStart":362.9000005722046},{"duration":147.30000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":363.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":363.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":510.5,"responseStart":0,"secureConnectionStart":0},{"duration":200.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":363.19999980926514,"connectEnd":363.19999980926514,"connectStart":363.19999980926514,"domainLookupEnd":363.19999980926514,"domainLookupStart":363.19999980926514,"fetchStart":363.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":513,"responseEnd":563.5,"responseStart":553.6000003814697,"secureConnectionStart":363.19999980926514},{"duration":816.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":370.5,"connectEnd":370.5,"connectStart":370.5,"domainLookupEnd":370.5,"domainLookupStart":370.5,"fetchStart":370.5,"redirectEnd":0,"redirectStart":0,"requestStart":683.4000005722046,"responseEnd":1187,"responseStart":1142.3000001907349,"secureConnectionStart":370.5},{"duration":817.1000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":370.69999980926514,"connectEnd":370.69999980926514,"connectStart":370.69999980926514,"domainLookupEnd":370.69999980926514,"domainLookupStart":370.69999980926514,"fetchStart":370.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":807.9000005722046,"responseEnd":1187.8000001907349,"responseStart":1147.3000001907349,"secureConnectionStart":370.69999980926514},{"duration":251.4000005722046,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1128,"connectEnd":1128,"connectStart":1128,"domainLookupEnd":1128,"domainLookupStart":1128,"fetchStart":1128,"redirectEnd":0,"redirectStart":0,"requestStart":1346.6000003814697,"responseEnd":1379.4000005722046,"responseStart":1378.8000001907349,"secureConnectionStart":1128},{"duration":466.30000019073486,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1447.6000003814697,"connectEnd":1447.6000003814697,"connectStart":1447.6000003814697,"domainLookupEnd":1447.6000003814697,"domainLookupStart":1447.6000003814697,"fetchStart":1447.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":1880.6999998092651,"responseEnd":1913.9000005722046,"responseStart":1913.3000001907349,"secureConnectionStart":1447.6000003814697}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":168,"responseStart":347,"responseEnd":362,"domLoading":351,"domInteractive":1888,"domContentLoadedEventStart":1888,"domContentLoadedEventEnd":1941,"domComplete":3083,"loadEventStart":3083,"loadEventEnd":3083,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1806.9000005722046},{"name":"bigPipe.sidebar-id.end","time":1807.8000001907349},{"name":"bigPipe.activity-panel-pipe-id.start","time":1807.9000005722046},{"name":"bigPipe.activity-panel-pipe-id.end","time":1809.6000003814697},{"name":"activityTabFullyLoaded","time":1960.9000005722046}],"measures":[],"correlationId":"720ec1d28a9e05","effectiveType":"4g","downlink":9.1,"rtt":0,"serverDuration":95,"dbReadsTimeInMs":13,"dbConnsTimeInMs":21,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
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?