Skip to content

mysql: find sockets on default mariadb installation on Debian#934

Open
mueller-ma wants to merge 1 commit into
Checkmk:masterfrom
dahag-ag:mariadb-sockets
Open

mysql: find sockets on default mariadb installation on Debian#934
mueller-ma wants to merge 1 commit into
Checkmk:masterfrom
dahag-ag:mariadb-sockets

Conversation

@mueller-ma

Copy link
Copy Markdown
Contributor

General information

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

Bug reports

No output of the current auto-detect code:

[root@mariadb ~]# ps -fww -C mysqld | grep "socket"
[root@mariadb ~]# ps -fww -C mariadbd | grep "socket"
[root@mariadb ~]#

Proposed changes

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

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
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants