/var/log/mysql does not exists on f20, f19, rhel7 by default,
but the /var/log/mariadb exists.
Change-Id: I0def3eaead491a00e6f8467db6b31502b9376188
| ... | ... |
@@ -47,6 +47,7 @@ function recreate_database_mysql {
|
| 47 | 47 |
} |
| 48 | 48 |
|
| 49 | 49 |
function configure_database_mysql {
|
| 50 |
+ local slow_log |
|
| 50 | 51 |
echo_summary "Configuring and starting MySQL" |
| 51 | 52 |
|
| 52 | 53 |
if is_ubuntu; then |
| ... | ... |
@@ -92,7 +93,11 @@ function configure_database_mysql {
|
| 92 | 92 |
|
| 93 | 93 |
if [[ "$DATABASE_QUERY_LOGGING" == "True" ]]; then |
| 94 | 94 |
echo_summary "Enabling MySQL query logging" |
| 95 |
- |
|
| 95 |
+ if is_fedora && ! [[ $DISTRO =~ (rhel6) ]]; then |
|
| 96 |
+ slow_log=/var/log/mariadb/mariadb-slow.log |
|
| 97 |
+ else |
|
| 98 |
+ slow_log=/var/log/mysql/mysql-slow.log |
|
| 99 |
+ fi |
|
| 96 | 100 |
sudo sed -e '/log.slow.queries/d' \ |
| 97 | 101 |
-e '/long.query.time/d' \ |
| 98 | 102 |
-e '/log.queries.not.using.indexes/d' \ |
| ... | ... |
@@ -102,7 +107,7 @@ function configure_database_mysql {
|
| 102 | 102 |
# 0 seconds) and log all non-indexed queries |
| 103 | 103 |
sudo bash -c "source $TOP_DIR/functions && \ |
| 104 | 104 |
iniset $MY_CONF mysqld slow-query-log 1 && \ |
| 105 |
- iniset $MY_CONF mysqld slow-query-log-file /var/log/mysql/mysql-slow.log && \ |
|
| 105 |
+ iniset $MY_CONF mysqld slow-query-log-file $slow_log && \ |
|
| 106 | 106 |
iniset $MY_CONF mysqld long-query-time 0 && \ |
| 107 | 107 |
iniset $MY_CONF mysqld log-queries-not-using-indexes 1" |
| 108 | 108 |
|