From 91ab8194512500d2d024c916d50d2113ff1338d1 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 31 Aug 2023 09:13:47 +1000 Subject: [PATCH] MDEV-25177 Better indication of refusing to start because of ProtectHome Create test for for case insensitive gives a basic warning on creating a test file and the next thing a user might see is an abort. ProtectHome and other systemd setting protect system services from accessing user data. Unfortunately some of our users do put things on /home due space or other reasons. Rather than enumberate the systemd options in a very clunkly fragile way we put an error associated with the "Can't create test file" and hope the user can work it out from there. %M tip thanks Sergei. --- sql/mysqld.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index c110baa9634..2a8e4b4c16b 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -9299,7 +9299,7 @@ static int test_if_case_insensitive(const char *dir_name) buff, 0666, O_RDWR, MYF(0))) < 0) { if (!opt_abort) - sql_print_warning("Can't create test file %s", buff); + sql_print_warning("Can't create test file '%s' (Errcode: %M)", buff, my_errno); DBUG_RETURN(-1); } mysql_file_close(file, MYF(0));