mysql: find sockets on default mariadb installation on Debian - #934
mueller-ma wants to merge 3 commits into
Conversation
The current auto-detect command doesn't work on a default MariaDB installation on Debian for two reasons: - The account is called mariadbd - No "socket" is in the CMD printed by ps As the default socket is `/run/mysqld/mysqld.sock`, use all sockets in `/run/mysqld` to support multi-instance setups. From new Debian installation: ``` root@ca9b0a452ef5:/# grep socket -Ri /etc/mysql/ /etc/mysql/my.cnf:# Port or socket location where to connect /etc/mysql/my.cnf:socket = /run/mysqld/mysqld.sock /etc/mysql/my.cnf.fallback:# Remember to edit /etc/mysql/debian.cnf when changing the socket location. /etc/mysql/debian.cnf:# anyway thanks to unix socket authentication and hence /etc/mysql/mariadb.cnf:# Port or socket location where to connect /etc/mysql/mariadb.cnf:socket = /run/mysqld/mysqld.sock ```
andrea-vaccaro
left a comment
There was a problem hiding this comment.
Is it possible to preserves the "mysql" name when exactly one socket is found and only use paths for multiple sockets so that existing service names are kept?
|
I pushed a commit that keeps the default name. |
|
Failed pipeline seems unrelated to me: |
|
Thanks for the quick update, the One more compatibility gap came up in internal review, and I could reproduce it on a Debian bookworm container: MariaDB multi-instance setups. Before this change the plugin fell back to Suggested fix: keep the empty instance name for the auto-detected default socket inside the loop, instead of keying on the socket count:
I tested this variant on all three setups:
All existing service names stay the same, new instances get their socket path as name, and the change can ship as a compatible fix. |
|
Good catch. Can you push that fix to my branch? |
closes #934 Change-Id: Ica2e3a11a1febdafc6388f1a29f9a16775325479 JIRA-Ref: CMK-36798
General information
The current auto-detect command doesn't work on a default MariaDB installation on Debian for two reasons:
Bug reports
No output of the current auto-detect code:
Proposed changes
As the default socket is
/run/mysqld/mysqld.sock, use all sockets in/run/mysqldto support multi-instance setups.From new Debian installation: