mysql-server-5.7.postinst fails on upgrade if the datadir has been changed from default
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mysql-5.7 (Ubuntu) |
Fix Released
|
Low
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Lars Tangvald |
Bug Description
The systemd service script for MySQL will report an error if it doesn't find a database in the default datadir, /var/lib/mysql
[Impact]
For users with custom datadir, this means they have to keep the default database in /var/lib/mysql as well, or the systemd service will refuse to start.
We change the systemd service script to check that a database exists in the directory found in the config, rather than the default.
[Test case]
* Install the mysql-server package, then stop the service
* Edit /etc/mysql/
* Delete all contents of /var/lib/mysql/
* Update apparmor profile to allow read/write access to new datadir
* Make sure the custom datadir exists, and run mysqld --initialize
* Try to start the service
[Regression Potential]
This change has been in Yakkety for some time (5.7.15-0ubuntu2).
Should the commands to fetch the value from the config not work right, it could break the systemd script whether the user has a proper database or not.
[Original description]
mysql upgrade fails if datadir (mysqld.cnf) is not /var/lib/mysql
ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: mysql-server-5.7 5.7.12-0ubuntu1
ProcVersionSign
Uname: Linux 4.4.0-21-generic x86_64
ApportVersion: 2.20.1-0ubuntu2
Architecture: amd64
Date: Mon Apr 25 19:31:55 2016
ErrorMessage: subprocess installed post-installation script returned error exit status 1
InstallationDate: Installed on 2015-11-30 (146 days ago)
InstallationMedia: Ubuntu 15.10 "Wily Werewolf" - Release amd64 (20151021)
Logs.var.
MySQLConf.
MySQLConf.
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
MySQLConf.
[mysqld_safe]
syslog
MySQLVarLibDirL
ProcCmdline: BOOT_IMAGE=
RelatedPackageV
dpkg 1.18.4ubuntu1
apt 1.2.10ubuntu1
SourcePackage: mysql-5.7
Title: package mysql-server-5.7 5.7.12-0ubuntu1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
UpgradeStatus: Upgraded to xenial on 2016-04-22 (3 days ago)
modified.
modified.
mtime.conffile.
mtime.conffile.
summary: |
- package mysql-server-5.7 5.7.12-0ubuntu1 failed to install/upgrade: - subprocess installed post-installation script returned error exit status - 1 + mysql-server-5.7.postinst fails on upgrade if the datadir has been + changed from default |
Changed in mysql-5.7 (Ubuntu): | |
importance: | Undecided → Low |
Changed in mysql-5.7 (Ubuntu): | |
status: | Confirmed → In Progress |
Changed in mysql-5.7 (Ubuntu): | |
status: | In Progress → Fix Committed |
tags: | added: mysql-alternate-datadir |
Changed in mysql-5.7 (Ubuntu Xenial): | |
status: | New → Triaged |
description: | updated |
Changed in mysql-5.7 (Ubuntu Xenial): | |
assignee: | nobody → Lars Tangvald (lars-tangvald) |
status: | Triaged → Fix Committed |
Changed in mysql-5.7 (Ubuntu Xenial): | |
status: | Fix Committed → In Progress |
Changed in mysql-5.7 (Ubuntu Xenial): | |
milestone: | none → xenial-updates |
description: | updated |
Status changed to 'Confirmed' because the bug affects multiple users.