Move Galera logs to /var/log/mysql_logs and set correct ownership

By default the permissions on the Galera log files are too restrictive
for rsyslog to read.  This patch moves those files to /var/log/mysql_log
and gives it group ownership of syslog.  Further it sets the sticky bit
on /var/log/mysql_log and ensures that the syslog group has read
access.

Change-Id: I57403a4147a07f949c78e648357070e23fe6d47f
Closes-bug: 1452316
This commit is contained in:
Dave Wilde 2015-05-06 16:03:14 -05:00 committed by Kevin Carter
parent 1bd2bc052a
commit 390e97ca7c
3 changed files with 4 additions and 3 deletions

View File

@ -45,7 +45,7 @@
roles:
- { role: "galera_server", tags: [ "galera-server" ] }
- role: "rsyslog_client"
rsyslog_client_log_dir: "/var/log/mysql"
rsyslog_client_log_dir: "/var/log/mysql_logs"
rsyslog_client_log_files:
- /var/log/mysql.log
- /var/log/mysql.err

View File

@ -23,6 +23,7 @@
recurse: "{{ item.recurse|default('false') }}"
with_items:
- { path: "/var/log/mysql/", owner: "mysql", recurse: "true" }
- { path: "/var/log/mysql_logs/", owner: "mysql", group: "syslog", mode: "2755" }
- { path: "/etc/mysql/conf.d" }
tags:
- galera-config

View File

@ -32,8 +32,8 @@ datadir = /var/lib/mysql
# LOGGING #
log-queries-not-using-indexes = 1
slow-query-log = 1
slow-query-log-file = /var/log/mysql/mysql-slow.log
log_error = /var/log/mysql/galera_server_error.log
slow-query-log-file = /var/log/mysql_logs/mysql-slow.log
log_error = /var/log/mysql_logs/galera_server_error.log
log-bin = /var/lib/mysql/mariadb-bin
log-bin-index = /var/lib/mysql/mariadb-bin.index
expire-logs-days = 7