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":887.2000000178814,"ttfb":198.40000000596046,"pageVisibility":"visible","entityId":75945,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"721c08ae-ce9e-4bfc-8d46-2d0eaa21c0e3","navigationType":0,"readyForUser":968.3000000119209,"redirectCount":0,"resourceLoadedEnd":1141.800000011921,"resourceLoadedStart":204,"resourceTiming":[{"duration":176.80000001192093,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":204,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":204,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":380.80000001192093,"responseStart":0,"secureConnectionStart":0},{"duration":176.59999999403954,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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","startTime":204.40000000596046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":204.40000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":381,"responseStart":0,"secureConnectionStart":0},{"duration":185.2000000178814,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":204.5,"connectEnd":204.5,"connectStart":204.5,"domainLookupEnd":204.5,"domainLookupStart":204.5,"fetchStart":204.5,"redirectEnd":0,"redirectStart":0,"requestStart":204.5,"responseEnd":389.7000000178814,"responseStart":389.7000000178814,"secureConnectionStart":204.5},{"duration":223.09999999403954,"initiatorType":"script","name":"https://jira.mariadb.org/s/c32eb0da7ad9831253f8397e6cc26afd-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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","startTime":204.7000000178814,"connectEnd":204.7000000178814,"connectStart":204.7000000178814,"domainLookupEnd":204.7000000178814,"domainLookupStart":204.7000000178814,"fetchStart":204.7000000178814,"redirectEnd":0,"redirectStart":0,"requestStart":204.7000000178814,"responseEnd":427.80000001192093,"responseStart":427.80000001192093,"secureConnectionStart":204.7000000178814},{"duration":226.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/bc0bcb146314416123c992714ee00ff7-CDN/lu2bv2/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":204.90000000596046,"connectEnd":204.90000000596046,"connectStart":204.90000000596046,"domainLookupEnd":204.90000000596046,"domainLookupStart":204.90000000596046,"fetchStart":204.90000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":204.90000000596046,"responseEnd":431.40000000596046,"responseStart":431.40000000596046,"secureConnectionStart":204.90000000596046},{"duration":227.2999999821186,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":205.10000002384186,"connectEnd":205.10000002384186,"connectStart":205.10000002384186,"domainLookupEnd":205.10000002384186,"domainLookupStart":205.10000002384186,"fetchStart":205.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":205.10000002384186,"responseEnd":432.40000000596046,"responseStart":432.40000000596046,"secureConnectionStart":205.10000002384186},{"duration":228.09999999403954,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":205.30000001192093,"connectEnd":205.30000001192093,"connectStart":205.30000001192093,"domainLookupEnd":205.30000001192093,"domainLookupStart":205.30000001192093,"fetchStart":205.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":205.30000001192093,"responseEnd":433.40000000596046,"responseStart":433.40000000596046,"secureConnectionStart":205.30000001192093},{"duration":323.7000000178814,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bv2/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":205.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":205.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":529.2000000178814,"responseStart":0,"secureConnectionStart":0},{"duration":228.7999999821186,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":205.7000000178814,"connectEnd":205.7000000178814,"connectStart":205.7000000178814,"domainLookupEnd":205.7000000178814,"domainLookupStart":205.7000000178814,"fetchStart":205.7000000178814,"redirectEnd":0,"redirectStart":0,"requestStart":205.7000000178814,"responseEnd":434.5,"responseStart":434.5,"secureConnectionStart":205.7000000178814},{"duration":323.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bv2/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":205.90000000596046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":205.90000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":529.4000000059605,"responseStart":0,"secureConnectionStart":0},{"duration":229.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/719848dd97ebe0663199f49a3936487a-CDN/lu2bv2/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":206,"connectEnd":206,"connectStart":206,"domainLookupEnd":206,"domainLookupStart":206,"fetchStart":206,"redirectEnd":0,"redirectStart":0,"requestStart":206,"responseEnd":435.5,"responseStart":435.5,"secureConnectionStart":206},{"duration":434.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":206.90000000596046,"connectEnd":206.90000000596046,"connectStart":206.90000000596046,"domainLookupEnd":206.90000000596046,"domainLookupStart":206.90000000596046,"fetchStart":206.90000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":206.90000000596046,"responseEnd":641.4000000059605,"responseStart":641.4000000059605,"secureConnectionStart":206.90000000596046},{"duration":934.8000000119209,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":207,"connectEnd":207,"connectStart":207,"domainLookupEnd":207,"domainLookupStart":207,"fetchStart":207,"redirectEnd":0,"redirectStart":0,"requestStart":207,"responseEnd":1141.800000011921,"responseStart":1141.800000011921,"secureConnectionStart":207},{"duration":101.69999998807907,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":540.6000000238419,"connectEnd":540.6000000238419,"connectStart":540.6000000238419,"domainLookupEnd":540.6000000238419,"domainLookupStart":540.6000000238419,"fetchStart":540.6000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":540.6000000238419,"responseEnd":642.3000000119209,"responseStart":642.3000000119209,"secureConnectionStart":540.6000000238419}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":26,"responseStart":198,"responseEnd":201,"domLoading":202,"domInteractive":1163,"domContentLoadedEventStart":1163,"domContentLoadedEventEnd":1203,"domComplete":1767,"loadEventStart":1767,"loadEventEnd":1768,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1143.7000000178814},{"name":"bigPipe.sidebar-id.end","time":1144.6000000238419},{"name":"bigPipe.activity-panel-pipe-id.start","time":1144.7000000178814},{"name":"bigPipe.activity-panel-pipe-id.end","time":1146.2000000178814},{"name":"activityTabFullyLoaded","time":1215.1000000238419}],"measures":[],"correlationId":"f7537d773d76b","effectiveType":"4g","downlink":9.4,"rtt":0,"serverDuration":98,"dbReadsTimeInMs":12,"dbConnsTimeInMs":20,"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?