summaryrefslogtreecommitdiff
path: root/debian/mariadb-server-10.2.mysql-server.logrotate
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-11-20 18:43:22 +0100
committerSergei Golubchik <serg@mariadb.org>2015-11-23 16:02:56 +0100
commit679aa122bf7f94c773c6553f5a7236aae3982bb3 (patch)
tree5c4251db29a8daca22af4b944dc0baa44ada9eed /debian/mariadb-server-10.2.mysql-server.logrotate
parentd73cf394a5361b33baf40afd2a8c1d4edac548c0 (diff)
downloadmariadb-git-679aa122bf7f94c773c6553f5a7236aae3982bb3.tar.gz
fix debian packaging for 10.2
Diffstat (limited to 'debian/mariadb-server-10.2.mysql-server.logrotate')
-rw-r--r--debian/mariadb-server-10.2.mysql-server.logrotate27
1 files changed, 27 insertions, 0 deletions
diff --git a/debian/mariadb-server-10.2.mysql-server.logrotate b/debian/mariadb-server-10.2.mysql-server.logrotate
new file mode 100644
index 00000000000..0f0de516b13
--- /dev/null
+++ b/debian/mariadb-server-10.2.mysql-server.logrotate
@@ -0,0 +1,27 @@
+# - I put everything in one block and added sharedscripts, so that mysql gets
+# flush-logs'd only once.
+# Else the binary logs would automatically increase by n times every day.
+# - The error log is obsolete, messages go to syslog now.
+/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log {
+ daily
+ rotate 7
+ missingok
+ create 640 mysql adm
+ compress
+ sharedscripts
+ postrotate
+ test -x /usr/bin/mysqladmin || exit 0
+
+ # If this fails, check debian.conf!
+ MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
+ if [ -z "`$MYADMIN ping 2>/dev/null`" ]; then
+ # Really no mysqld or rather a missing debian-sys-maint user?
+ # If this occurs and is not a error please report a bug.
+ if ps cax | grep -q mysqld; then
+ exit 1
+ fi
+ else
+ $MYADMIN flush-logs
+ fi
+ endscript
+}