[Maria-discuss] Flush logs does not recreate slowlog.
Hi All. I use: MariaDB-server-5.5.30-1.x86_64 on CentOS release 6.4 (Final) 2.6.32-358.el6.x86_64 "flush logs" or "flush slow logs" does not recreate the file. In https://dev.mysql.com/doc/refman/5.5/en/flush.html there is "With no log_type option, FLUSH LOGS closes and reopens all log files." and "With a log_type option, only the specified log type is flushed." but neither command recreates the log file. I rotate slowlog through crontab: mv /var/log/mysqld-slow.log /var/log/mysqld-slow.log.old ; mysqladmin flush-logs Is it a bug or should it be so for some reason? Best regards, Rafal.
Strange. I don't have a 5.5.30 build handy but I tried this on my trunk build of mariadb using the sql command and it works: ebergen@santa:(~/store/mysql/standalone_mariadb) ls -li mysql/slow.log 52430026 -rw-rw----. 1 ebergen ebergen 244 May 23 11:56 mysql/slow.log ebergen@santa:(~/store/mysql/standalone_mariadb) mv mysql/slow.log{,.old} ebergen@santa:(~/store/mysql/standalone_mariadb) ls -li mysql/slow.log ls: cannot access mysql/slow.log: No such file or directory ebergen@santa:(~/store/mysql/standalone_mariadb) ./con Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 4 Server version: 5.5.5-10.0.2-MariaDB-log Source distribution Copyright (c) 2000, 2012, Oracle, Monty Program Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> flush slow logs; Query OK, 0 rows affected (0.04 sec) MariaDB [(none)]> Ctrl-C -- exit! Aborted ebergen@santa:(~/store/mysql/standalone_mariadb) ls -li mysql/slow.log* 52430011 -rw-rw----. 1 ebergen ebergen 244 May 23 11:59 mysql/slow.log 52430026 -rw-rw----. 1 ebergen ebergen 244 May 23 11:56 mysql/slow.log.old Same with mysqladmin: ebergen@santa:(~/store/mysql/standalone_mariadb) mv mysql/slow.log{,.old} ebergen@santa:(~/store/mysql/standalone_mariadb) ls -li mysql/slow.log* 52430011 -rw-rw----. 1 ebergen ebergen 488 May 23 12:01 mysql/slow.log.old ebergen@santa:(~/store/mysql/standalone_mariadb) mysqladmin -S ./mysql.sock flush-logs ebergen@santa:(~/store/mysql/standalone_mariadb) ls -li mysql/slow.log* 52430026 -rw-rw----. 1 ebergen ebergen 244 May 23 12:02 mysql/slow.log 52430011 -rw-rw----. 1 ebergen ebergen 488 May 23 12:01 mysql/slow.log.old Are you capturing errors from your crontab? Does running the command by hand work? On Thu, May 23, 2013 at 1:11 AM, Rafał Radecki <radecki.rafal@gmail.com> wrote:
Hi All.
I use: MariaDB-server-5.5.30-1.x86_64 on CentOS release 6.4 (Final) 2.6.32-358.el6.x86_64
"flush logs" or "flush slow logs" does not recreate the file. In https://dev.mysql.com/doc/refman/5.5/en/flush.html there is "With no log_type option, FLUSH LOGS closes and reopens all log files." and "With a log_type option, only the specified log type is flushed." but neither command recreates the log file.
I rotate slowlog through crontab: mv /var/log/mysqld-slow.log /var/log/mysqld-slow.log.old ; mysqladmin flush-logs
Is it a bug or should it be so for some reason?
Best regards, Rafal.
_______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
-- Eric Bergen eric.bergen@gmail.com http://www.ebergen.net
Running command from hand does not work as expected -> the slowlog is not recreated. 2013/5/23 Eric Bergen <eric.bergen@gmail.com>
Strange. I don't have a 5.5.30 build handy but I tried this on my trunk build of mariadb using the sql command and it works:
ebergen@santa:(~/store/mysql/standalone_mariadb) ls -li mysql/slow.log 52430026 -rw-rw----. 1 ebergen ebergen 244 May 23 11:56 mysql/slow.log
ebergen@santa:(~/store/mysql/standalone_mariadb) mv mysql/slow.log{,.old}
ebergen@santa:(~/store/mysql/standalone_mariadb) ls -li mysql/slow.log ls: cannot access mysql/slow.log: No such file or directory
ebergen@santa:(~/store/mysql/standalone_mariadb) ./con Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 4 Server version: 5.5.5-10.0.2-MariaDB-log Source distribution
Copyright (c) 2000, 2012, Oracle, Monty Program Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> flush slow logs; Query OK, 0 rows affected (0.04 sec)
MariaDB [(none)]> Ctrl-C -- exit! Aborted
ebergen@santa:(~/store/mysql/standalone_mariadb) ls -li mysql/slow.log* 52430011 -rw-rw----. 1 ebergen ebergen 244 May 23 11:59 mysql/slow.log 52430026 -rw-rw----. 1 ebergen ebergen 244 May 23 11:56 mysql/slow.log.old
Same with mysqladmin: ebergen@santa:(~/store/mysql/standalone_mariadb) mv mysql/slow.log{,.old}
ebergen@santa:(~/store/mysql/standalone_mariadb) ls -li mysql/slow.log* 52430011 -rw-rw----. 1 ebergen ebergen 488 May 23 12:01 mysql/slow.log.old
ebergen@santa:(~/store/mysql/standalone_mariadb) mysqladmin -S ./mysql.sock flush-logs
ebergen@santa:(~/store/mysql/standalone_mariadb) ls -li mysql/slow.log* 52430026 -rw-rw----. 1 ebergen ebergen 244 May 23 12:02 mysql/slow.log 52430011 -rw-rw----. 1 ebergen ebergen 488 May 23 12:01 mysql/slow.log.old
Are you capturing errors from your crontab? Does running the command by hand work?
On Thu, May 23, 2013 at 1:11 AM, Rafał Radecki <radecki.rafal@gmail.com> wrote:
Hi All.
I use: MariaDB-server-5.5.30-1.x86_64 on CentOS release 6.4 (Final) 2.6.32-358.el6.x86_64
"flush logs" or "flush slow logs" does not recreate the file. In https://dev.mysql.com/doc/refman/5.5/en/flush.html there is "With no log_type option, FLUSH LOGS closes and reopens all log files." and "With a log_type option, only the specified log type is flushed." but neither command recreates the log file.
I rotate slowlog through crontab: mv /var/log/mysqld-slow.log /var/log/mysqld-slow.log.old ; mysqladmin flush-logs
Is it a bug or should it be so for some reason?
Best regards, Rafal.
_______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
-- Eric Bergen eric.bergen@gmail.com http://www.ebergen.net
participants (2)
-
Eric Bergen
-
Rafał Radecki