[debian-mysql] Bug#792918: mariadb-10.0: upgrade fails when /var/lib/mysql is a soft link

Israel Tsadok itsadok at gmail.com
Mon Jul 20 05:46:14 UTC 2015


Source: mariadb-10.0
Severity: normal

Dear Maintainer,

I'm actually an ubuntu user, and reported this bug at
https://bugs.launchpad.net/ubuntu/+source/mariadb-10.0/+bug/1474212, but I
thought to report it upstream as well. If this is inappropriate, I
apologize.

apt-get dist-upgrade failed for me on the mariadb-server-10.0 package, with
the error

cp: cannot overwrite directory ‘/var/lib/mysql-upgrade/DATADIR.link/mysql’
with non-directory

I tracked it down to line 144 in mariadb-server-10.0.preinst, which tries
to save the soft link that /var/lib/mysql points to by copying it
to /var/lib/mysql-upgrade/DATADIR.link/mysql. However, since the target
link already exists, cp tried to copy /var/lib/mysql into the directory
that /var/lib/mysql-upgrade/DATADIR.link/mysql points to, which is wrong
and luckily failed fast rather than just silently doing the wrong thing.

The fix is simple: add -T to the cp command.

Perhaps the bug is that the previous upgrade didn't clean up and left the
soft link under /var/lib/mysql-upgrade, I don't know. In any case, -T does
the trick.


-- System Information:
Debian Release: jessie/sid
  APT prefers vivid-updates
  APT policy: (500, 'vivid-updates'), (500, 'vivid-security'), (500,
'vivid'), (100, 'vivid-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.19.0-22-generic (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-mysql-maint/attachments/20150720/cc725b46/attachment.html>


More information about the pkg-mysql-maint mailing list