Commit Graph

3 Commits

Author SHA1 Message Date
Michal Hrusecky 1be35284bb mariadb: Init script improvements
Update init script so other user/group can be used. Also make sure that
init script can actually create an empty database instead of forcing the
user to do it by hand. Other new feature is taking care of migration
of the database when upgrading the database.

Signed-off-by: Michal Hrusecky <michal.hrusecky@turris.com>
2021-11-29 01:47:45 -08:00
Sebastian Kemper fa6ea0b137 mariadb: switch init to mysqld_safe and mysqladmin
mysqld_safe is the recommended way to start the server on non-systemd
systems ([1]). For instance, it has a crash detection with auto-restart
function, can update ulimits, setup core files, set the niceness of the
server etc. It looks like it could also be helpful when trying to set up
clusters. It's maintained upstream and adding it means we don't need to
add these features into our init script.

mysqld_safe is a script itself, so it's added to conffiles in case users
want to edit it.

It can't be run under procd, so the init script is converted to a normal
System V type. To stop the server and to reload the privileges tables
mysqladmin is used. To that end mysqladmin is moved into the server
package.

While changing the init script, the Debian init script was used for
ideas. It wasn't copied verbatim and adapted a bit here and there.
Thanks to whoever wrote it!

This commit removes the support for starting the service as a user other
than "mariadb". This makes the init script simpler. If anybody wants to
play around with the user then it's up to them to fix the permissions.

[1] https://mariadb.com/kb/en/mysqld_safe/

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2020-05-12 00:13:11 +02:00
Sebastian Kemper 2de1c6c05f mariadb: update init script to use uci
Does away with /etc/default/mysqld, introduces uci configuration
instead. The init script receives some further brushing up, like a
function (copied from Debian) to get mysqld configuration parameters
easily and quickly.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2018-12-15 17:17:24 +01:00