hestiacp / hestiacp

Hestia Control Panel | A lightweight and powerful control panel for the modern web.
https://hestiacp.com
GNU General Public License v3.0
3.31k stars 675 forks source link

[BUG] MariaDB configuration files can not be edited properly in Web Interface after 10.4.1 #1806

Open rigin opened 3 years ago

rigin commented 3 years ago

Describe the bug

Hello.

After the Ubuntu 18.04 OS update, MariaDB changed the structure of the configuration files.

When you try to edit variables in the /etc/mysql/my.cnf file, which is still displayed in the admin panel, the server crashes.

Now all variables should be written in the file /etc/mysql/mariadb.conf.d/50-server.cnf, but it is not edited from the admin panel.

Where is the mariadb edit page template located?

jaapmarcus commented 3 years ago

my.cnf can be found here https://github.com/hestiacp/hestiacp/tree/main/install/deb/mysql

We only do a search and replace function with sed. Not the most optimal way.

We should probally update the current method....

rigin commented 3 years ago

That's not what I meant. Changing the location of the config, which now needs to be edited, led to the situation that it is impossible to edit the MariaDB settings from the hestaCP admin panel. :8083/edit/server/mariadb/

Where is the MariaDB settings page template located?

There my need to change the path to the config file so that it can be edited.

There you need to change the path to the config file so that it can be edited.

ioannidesalex commented 3 years ago

Not all MariaDB or OS versions we support use the “new” MariaDB structure of symlinking my.cnf

For example a user has MariaDB 10.4.1 and updates to the latest version via apt-get who uses the “new” structure. How shall Hestia know in order to make the amendment? It will be a performance killer of the UI to check each time where the valid conf file is.

if you have a better idea please submit a PR.

rigin commented 3 years ago

It was through apt-get that I updated the system.

In addition to hestia, there are a lot of other things on my server, so I usually update the software this way.

This is standard procedure for Ubuntu. Any manipulation of the system is always advised to start with the commands apt-get update | apt-get upgrade. I didn't know I couldn't do that for hestia.

Is it possible to manually adjust the panel to the new configuration?

In the future, it makes sense to make an output for editing all files from the /etc/mysql/mariadb.conf directories.d/ and /etc/mysql/conf. d/. This will solve the problem with the mariadb configuration difference.

ioannidesalex commented 3 years ago

I think you didn't understand what I mentioned. What I am saying is that current behaviour (modifying just /etc/mysql/my.cnf) is valid for earlier MariaDB versions. We need to figure out a way to accomodate each and every supported version, mostly on CLI level.

What manipulation of the system are you referring to?

rigin commented 3 years ago

apt-get update apt-get upgrade

After that, MariaDB was updated and its config structure changed.