[debian-mysql] Bug#850216: Bug#850216: mysql-server-5.6: Listens on * by default after installation (related to use of alternatives)

Otto Kekäläinen otto at debian.org
Fri Mar 10 15:09:42 UTC 2017


For the record:

2017-01-05 8:07 GMT+02:00 Salvatore Bonaccorso <carnil at debian.org>:
> Hi
>
> When installing myssql-server-5.6 in stretch and sid, then mysqld is
> started and listend not binding on localhost only, but listen on *.
>
> tcp    LISTEN     0      80     :::mysql                :::*                     users:(("mysqld",pid=2810,fd=10))
>
> This issue seems related to the switch to use the alternatives system for my.cnf, now mysql-5.6 as well picking the mariadb.cnf in auto mode.
>
> That one includes
>
> !includedir /etc/mysql/conf.d/
> !includedir /etc/mysql/mariadb.conf.d/
>
> and thus the installation ends without
>
> bind-address            = 127.0.0.1


If mariadb-common for whatever reason is installed, the
update-alternatives will point my.cnf to the MariaDB version (which is
correct).
If at a later point for example mysql-server is installed, it will put
it's config files in /etc/mysql/ correctly, but it fails to trigger an
update to the alternatives system.

This is how it looks like after installing mysql-server in sid (pulls
in mysql-server-5.7 et al):

root at scw-76e757:/etc/mysql# ls -la
total 40
drwxr-xr-x  5 root root 4096 Mar 10 14:38 .
drwxr-xr-x 73 root root 4096 Mar 10 14:38 ..
drwxr-xr-x  2 root root 4096 Mar 10 14:35 conf.d
-rw-------  1 root root  317 Mar 10 14:38 debian.cnf
-rwxr-xr-x  1 root root  120 Feb  1 00:12 debian-start
-rw-r--r--  1 root root  869 Oct  1 22:11 mariadb.cnf
drwxr-xr-x  2 root root 4096 Jan 27 18:42 mariadb.conf.d
lrwxrwxrwx  1 root root   24 Mar 10 14:35 my.cnf -> /etc/alternatives/my.cnf
-rw-r--r--  1 root root  839 Jul  9  2016 my.cnf.fallback
-rw-r--r--  1 root root  682 Feb  1 00:12 mysql.cnf
drwxr-xr-x  2 root root 4096 Mar 10 14:38 mysql.conf.d

root at scw-76e757:/etc/mysql# ls -la /etc/alternatives/my.cnf
lrwxrwxrwx 1 root root 22 Mar 10 14:35 /etc/alternatives/my.cnf ->
/etc/mysql/mariadb.cnf

root at scw-76e757:/etc/mysql# update-alternatives --display my.cnf
my.cnf - auto mode
  link best version is /etc/mysql/mariadb.cnf
  link currently points to /etc/mysql/mariadb.cnf
  link my.cnf is /etc/mysql/my.cnf
/etc/mysql/mariadb.cnf - priority 200
/etc/mysql/my.cnf.fallback - priority 100
/etc/mysql/mysql.cnf - priority 200

Both have the same priority and the one installed first stays active.
Same happens if mariadb-common in uninstalled and installed again: the
mysql.cnf would stay as the active one.

I wonder if this really is how update-alternatives should be used and
is really adding conflicts between all packages that use it the smart
way to utilize the flexibility the update-alternatives scheme should
provide.



More information about the pkg-mysql-maint mailing list