Package: puppet-module-puppetlabs-mysql / 15.0.0-3

fix-creation-of-var-log-mysql.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Description: Fix missing creation of /var/log/mysql
 Since this commit:
 https://salsa.debian.org/mariadb-team/mariadb-server/-/merge_requests/27
 the mariadb-server package in Debian doesn't create /var/log/mysql, which
 makes mysql::server::installdb fail.
 .
 This patch adds creating of /var/log/mysql in the installdb.pp itself, to
 fix the current situation.
Author: Jérôme Charaoui <jerome@riseup.net>
Forwarded: https://github.com/puppetlabs/puppetlabs-mysql/pull/1622

This patch aligns with the new package default of not creating a
`/var/log/mysql` directory on installation.
Index: puppet-module-puppetlabs-mysql/manifests/params.pp
===================================================================
--- puppet-module-puppetlabs-mysql.orig/manifests/params.pp
+++ puppet-module-puppetlabs-mysql/manifests/params.pp
@@ -176,7 +176,6 @@ class mysql::params {
       $config_file             = '/etc/mysql/my.cnf'
       $includedir              = '/etc/mysql/conf.d'
       $datadir                 = '/var/lib/mysql'
-      $log_error               = '/var/log/mysql/error.log'
       $pidfile                 = '/var/run/mysqld/mysqld.pid'
       $root_group              = 'root'
       $mysql_group             = 'adm'
@@ -187,6 +186,14 @@ class mysql::params {
       $tmpdir                  = '/tmp'
       $managed_dirs            = ['tmpdir','basedir','datadir','innodb_data_home_dir','innodb_log_group_home_dir','innodb_undo_directory','innodb_tmpdir']
 
+      # log_error base directory absent in Debian >= 12
+      if ($facts['os']['name'] == 'Debian' and versioncmp($facts['os']['release']['full'], '12') >= 0) or
+      ($facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['full'], '23.10') >= 0) {
+        $log_error = undef
+      } else {
+        $log_error = '/var/log/mysql/error.log'
+      }
+
       # mysql::bindings
       if ($facts['os']['name'] == 'Debian' and versioncmp($facts['os']['release']['full'], '10') >= 0) or
       ($facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['full'], '20.04') >= 0) {