Why is this error still happening such a long time after it was
reported the first time, even now in version 64.0 (build 36)?
This should have been solved, and much more systematically than here
in this thread before. Even after reading all posts before, only lots
of trial and error brought some deeper understanding, and hence this
write-up, in the hope that cPanel will implement the solution, and
others who face the error and cannot configure as they want find help.
It is important to note,
that cPanel's own (re)start script (/scripts/restartsrv_mysql)
does not help to solve this problem (as it doesn't reload the daemon,
and hence new settings are not loaded)
as the error is shown still even though it might be resolved
already.
Only restarting mysql with this sequence will help:
# systemctl daemon-reload
# systemctl restart mysql
and then checking with
# systemctl status mysql
and the aforementioned:
# cat /proc/$(pidof mysqld)/limits |grep files
or
# mysqladmin variables|grep open_files_limit
will confirm the state of affairs (still w/ or finally w/o error).
By commenting out subsequently from modified files,
tested for order of precedence as found:
#1
/etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf
#2
/etc/systemd/system/mariadb.service.d/limits.conf
(#2 is needed, as upcp overwrites #3)
#3
/etc/systemd/system/mysql.service
#4
even though one might expect it to take still existing settings of
/etc/systemd/system/mysql.service.d/limits.conf
it does not and goes to a (minimum?) of 1024.
This would have been clear if cPanel would use the
# systemctl status mysql
which shows:
the drop-in (ie .conf files), ie the key hint toward the solution:
# systemctl status mysql
● mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─limits.conf, migrated-from-my.cnf-settings.conf
Active: active (running) since ... ago
Process: 21400 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 21217 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
Process: 21215 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Main PID: 21361 (mysqld)
Status: "Taking your SQL requests now..."
CGroup: /system.slice/mariadb.service
└─21361 /usr/sbin/mysqld
... systemd[1]: Starting MariaDB database server...
... mysqld[21361]: ... [Note] /usr/sbin/mysqld (mysqld 10.1.25-MariaDB) starting as process 21361 ...
... mysqld[21361]: ... [Warning] Could not increase number of max_open_files to more than 10000 (request: 41011)
... systemd[1]: Started MariaDB database server.
#
Can you guys at cPanel please make sure there is more testing and
error avoidance, especially re databases and mail? Thanks!
PS: Just reread this and thought, oh my, they must think I hate them. But that is not the case, so to make sure there is no confusion: Love you guys, you produce the best control panel there is! Just want to encourage you to systematize and test more, and attend to important errors earlier