Verified that 5.7.17-0ubuntu0.16.04.2 fixes this issue.

Note that the test case was missing a couple of steps: 
You need to erase the database in /var/lib/mysql to trigger the bug, and update 
the apparmor profile to make the custom datadir work

** Tags removed: verification-needed
** Tags added: verification-done

** Description changed:

  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/mysql.conf.d/mysqld.cnf and change datadir
+ * 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
  ProcVersionSignature: Ubuntu 4.4.0-21.37-generic 4.4.6
  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.log.daemon.log:
  
  MySQLConf.etc.mysql.conf.d.mysql.cnf: [mysql]
  MySQLConf.etc.mysql.conf.d.mysqldump.cnf:
   [mysqldump]
   quick
   quote-names
   max_allowed_packet   = 16M
  MySQLConf.etc.mysql.mysql.conf.d.mysqld_safe_syslog.cnf:
   [mysqld_safe]
   syslog
  MySQLVarLibDirListing: ['debian-5.7.flag']
  ProcCmdline: BOOT_IMAGE=/boot/vmlinuz-4.4.0-21-generic 
root=UUID=402be1c6-5faf-4404-9598-4ec21d975aa8 ro quiet splash vt.handoff=7
  RelatedPackageVersions:
   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.conffile..etc.apparmor.d.usr.sbin.mysqld: [modified]
  modified.conffile..etc.mysql.mysql.conf.d.mysqld.cnf: [modified]
  mtime.conffile..etc.apparmor.d.usr.sbin.mysqld: 2016-04-24T12:43:49.748706
  mtime.conffile..etc.mysql.mysql.conf.d.mysqld.cnf: 2016-04-24T12:45:04.992172

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1574782

Title:
  mysql-server-5.7.postinst fails on upgrade if the datadir has been
  changed from default

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1574782/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to