monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unixsocket test of MariaDB (mysql) with unix_socket authentication p


From: Jan-Henrik Haukeland
Subject: Re: unixsocket test of MariaDB (mysql) with unix_socket authentication plugin installed
Date: Thu, 25 Jul 2024 17:57:54 +0200



On 25 Jul 2024, at 01:25, David Fletcher <David@megapico.co.uk> wrote:


if failed unixsocket /tmp/mysql.sock protocol mysql timeout 90 seconds
then restart

On a new installation with MariaDB version 10.11.3 on Raspbian 12 (based
on Debian 12), Monit (version 5.33.0) kept reporting that MariaDB could
not be started. Actually it was being started and then restarted
generating a mess, because Monit could not connect to the unix socket.

I’m pretty sure the problem would be fixed if you added a username and password to perform authentication, especially if the new MariaDB installation uses authentication. 

if failed unixsocket /tmp/mysql.sock 
protocol mysql username "foo" password “bar"
timeout 90 seconds
then restart

Without username/password monit will attempt a so-called anonymous login which seems to be denied (probably a good thing). If this failed, well then monit, is configured to ‘restart' MariaDB. Using ‘alert’ would be less intrusive here. 

I found that disabling the unixsocket test enabled startup

That’s fair, but without authentication, this check probably does not do much to ensure that MariaDB is up and running, except checking that a unixsocket file exist.  

*
Since Ubuntu 15.10 based on Debian 9 this unix_socket authentication has
been a default so probably it's catching many people out.

Seems that the stock configuration for Monit, done by the Debian maintainer (and inherited by Ubuntu) has a few gotchas. It is unfortunate. He also added systems hardening which limit Monit and also could cause problems. 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]