From bc18f4c3ad4162be88a94de0bf084617c309d173 Mon Sep 17 00:00:00 2001 From: Faustin Lammler Date: Mon, 21 Jul 2025 09:47:33 +0200 Subject: [PATCH] Fix #50: adapt pid file default path Note: by default MDBF packages use a different path than official distro's packages. IMO the behavior of distro is cleaner, so, make sure that the directory exist in case we deploy MDBF packages. Note2: the pid file option does not seem to be mandatory for systemd and docker, so we might also decide to remove this option by default. But for the moment it's probably cleaner/simpler to keep default options deployed with packages. --- tasks/setup_redhat.yml | 11 +++++++++++ vars/RedHat.yml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tasks/setup_redhat.yml b/tasks/setup_redhat.yml index 134dd7c..2df92c9 100644 --- a/tasks/setup_redhat.yml +++ b/tasks/setup_redhat.yml @@ -38,6 +38,17 @@ state: present when: mariadb_use_official_repo +# the following is needed since MDBF packages server installation doesn't +# create the run dir directory which should probably be fixed upstream. +- name: Make sure run dir exist + ansible.builtin.file: + path: /run/mariadb + state: directory + owner: "{{ mariadb_user }}" + group: "{{ mariadb_user }}" + mode: 0755 + when: mariadb_use_official_repo + - name: Check if mariadb command exists ansible.builtin.stat: path: /usr/bin/mariadb diff --git a/vars/RedHat.yml b/vars/RedHat.yml index 683a2e8..897c1b4 100644 --- a/vars/RedHat.yml +++ b/vars/RedHat.yml @@ -4,7 +4,7 @@ mariadb_server_package: mariadb-server mariadb_server_package_mdbf: MariaDB-server mariadb_config_file: "/etc/my.cnf.d/mariadb-server.cnf" mariadb_data_dir: "/var/lib/mysql" -mariadb_pid_file: "/run/mysqld.pid" +mariadb_pid_file: "/run/mariadb/mysqld.pid" mariadb_unix_socket: "/var/lib/mysql/mysql.sock" mariadb_log_dir: "/var/log/mariadb" mariadb_log_error_file: "{{ mariadb_log_dir }}/error.log"