Bug #91405 | Can't update/remove mysql on host system if you have running mysql in docker | ||
---|---|---|---|
Submitted: | 25 Jun 2018 10:20 | Modified: | 7 May 2019 17:58 |
Reporter: | Evgeniy Patlan (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Packaging | Severity: | S2 (Serious) |
Version: | 8.0.1, 5.7.22 | OS: | Any |
Assigned to: | Lars Tangvald | CPU Architecture: | Any |
[25 Jun 2018 10:20]
Evgeniy Patlan
[26 Jun 2018 7:57]
Terje Røsten
Hi! Thanks for your report! Can you explain why you what to upgrade MySQL server inside a running docker image? To switch to new release you should start a new a image with wanted MySQL server version inside.
[26 Jun 2018 8:02]
Evgeniy Patlan
I'm trying to update/remove mysql on the HOST machine. Let me explain it in another words: I have machine which is running mysql locally and on the same machine I have docker which is also running mysql. So while updating/removing locally installed mysql the issue appeared
[26 Jun 2018 8:12]
Terje Røsten
Sorry, now I understand what you. MySQL deb packaging scripts in host get confused by other mysqld running inside docker on the same machine, this is due too simple logic to count mysqlds: ps -ef | grep "/usr/sbin/mysqld" | wc -l
[26 Jun 2018 8:18]
Evgeniy Patlan
Yes I understand this situation. That's why I've submitted bug report. There are several ways to proceed: - use Debian's start-stop-daemon infrastructure - detect if it is docker: for example The most reliable way is to check /proc/${pid}/cgroup. It will tell you the control groups of the init process, and when you are not in a container, that will be / for all hierarchies. On the first glance the easiest way is to check cgroup and exclude process if it is running in docker or in lxc.
[26 Jun 2018 8:19]
Terje Røsten
At first clance it seems like using start-stop-daemon infrastructure is the best way forward. Thanks again for you report and suggestions!
[26 Jun 2018 8:21]
Terje Røsten
Might be using cgroup is better, as least using old school ps and wc is not the way forward :-)
[10 Jul 2018 7:35]
Lars Tangvald
I don't think we actually need these checks at all for an upgrade. It is entirely valid for a debian|ubuntu user to have disabled the service (so all starting|stopping of the service needs to be manual), in which case an upgrade should be able to complete without stopping the old server process or starting a new one. We'll go through these scripts and update them for this scenario (we'll probably still want some check on this for a package purge, at least).
[7 May 2019 17:58]
Paul DuBois
Posted by developer: Fixed in 8.0.15. If MySQL was running on the host system and within Docker, it was not possible to update or remove MySQL on the host system.