From 8db0f6ac1ab665edde0723b4683222bdcbc5d345 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 22 Apr 2021 12:08:08 +1000 Subject: [PATCH] Document systemd service changes Prefer the systemctl edit mysql.service syntax and leave the more complex alternatives to the existing documents referenced. Also show how to use the multiinstance a bit more. Cherry-picked from Fedora: https://src.fedoraproject.org/rpms/mariadb/c/a87e9e5d9adb24ca55cd6ba98a9b45f18d5d5f2e?branch=rawhide Related: #1971248 --- mysql.service.in | 28 ++++++++++---------------- mysql@.service.in | 51 +++++++++++++++++++++++++++-------------------- 2 files changed, 39 insertions(+), 40 deletions(-) diff --git a/mysql.service.in b/mysql.service.in index 028e6d5..91dfeca 100644 --- a/mysql.service.in +++ b/mysql.service.in @@ -1,28 +1,20 @@ # It's not recommended to modify this file in-place, because it will be # overwritten during package upgrades. If you want to customize, the -# best way is to create a file "/etc/systemd/system/@DAEMON_NAME@.service", -# containing -# .include /usr/lib/systemd/system/@DAEMON_NAME@.service -# ...make your changes here... -# or create a file "/etc/systemd/system/@DAEMON_NAME@.service.d/foo.conf", -# which doesn't need to include ".include" call and which will be parsed -# after the file @DAEMON_NAME@.service itself is parsed. +# best way is to: +# +# root> systemctl edit @DAEMON_NAME@.service +# +# Then add additonal directives under a section (probably [Service]). # # For more info about custom unit files, see systemd.unit(5) or # http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F - -# For example, if you want to increase mysql's open-files-limit to 10000, -# you need to increase systemd's LimitNOFILE setting, so create a file named -# "/etc/systemd/system/@DAEMON_NAME@.service.d/limits.conf" containing: +# +# For example, if you want to increase MariaDB's open-files-limit to 10000, +# you need to increase systemd's LimitNOFILE setting, use the contents below: +# # [Service] # LimitNOFILE=10000 - -# Note: /usr/lib/... is recommended in the .include line though /lib/... -# still works. -# Don't forget to reload systemd daemon after you change unit configuration: -# root> systemctl --system daemon-reload - -# Use [mysqld.INSTANCENAME] as sections in my.cnf to configure this instance. +# [Unit] Description=@NICE_PROJECT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@ database server diff --git a/mysql@.service.in b/mysql@.service.in index 6e4039d..acb2c57 100644 --- a/mysql@.service.in +++ b/mysql@.service.in @@ -1,36 +1,43 @@ -# Multi instance version of mariadb. For if you run mutiple verions at once. +# Multi instance version of MariaDB. For if you run mutiple verions at once. # Also used for @DAEMON_NAME@@bootstrap to bootstrap Galera. # -# To use multi instance variant, use [mysqld.INSTANCENAME] as sections in my.cnf +# To use multi instance variant, use [mariadbd.INSTANCENAME] as sections in +# @sysconfdir@/@my.cnf to change per instance settings. A minimumal necessary +# configuration items to change to avoid conflicts between instances is: +# +# [mariadbd.instancename] +# # TCP port to make available for clients +# port=3306 +# # Socket to make available for clients +# socket=/tmp/mariadb-instancename.sock +# # Where MariaDB should store all its data +# datadir=/usr/local/mariadb-instancename/data +# # and start the service via: -# systemctl start @DAEMON_NAME@@{instancename}.server +# +# root> systemctl start @DAEMON_NAME@@{instancename}.server # # It's not recommended to modify this file in-place, because it will be -# overwritten during package upgrades. If you want to customize, the -# best way is to create a file "/etc/systemd/system/@DAEMON_NAME@.service", -# containing -# .include /usr/lib/systemd/system/@DAEMON_NAME@.service -# ...make your changes here... -# or create a file "/etc/systemd/system/@DAEMON_NAME@.service.d/foo.conf", -# which doesn't need to include ".include" call and which will be parsed -# after the file @DAEMON_NAME@.service itself is parsed. +# overwritten during package upgrades. If you want to customize, for +# all instances, the best way is: +# +# root> systemctl edit @DAEMON_NAME@@.service +# +# Then add additonal directives under a section (probably [Service]). +# +# If you only want to change a specific instance: +# +# root> systemctl edit @DAEMON_NAME@@{instancename}.server # # For more info about custom unit files, see systemd.unit(5) or # http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F - -# For example, if you want to increase mysql's open-files-limit to 10000, -# you need to increase systemd's LimitNOFILE setting, so create a file named -# "/etc/systemd/system/@DAEMON_NAME@.service.d/limits.conf" containing: +# +# For example, if you want to increase MariaDB's open-files-limit to 10000, +# you need to increase systemd's LimitNOFILE setting, use the contents below: +# # [Service] # LimitNOFILE=10000 -# Note: /usr/lib/... is recommended in the .include line though /lib/... -# still works. -# Don't forget to reload systemd daemon after you change unit configuration: -# root> systemctl --system daemon-reload - -# Use [mysqld.INSTANCENAME] as sections in my.cnf to configure this instance. - [Unit] Description=@NICE_PROJECT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@ database server Documentation=man:mariadbd(8)