summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2016-03-10 13:08:34 +0400
committerSergey Vojtovich <svoj@mariadb.org>2016-03-10 13:08:34 +0400
commit8942824a5304e23f765b88d07498786d80092843 (patch)
tree35eff3b364de10e2b701cb0c978aceaf48f49e30 /debian
parentd7721fcf6cc140c48eb9f08f045a60ca981fda7e (diff)
downloadmariadb-git-8942824a5304e23f765b88d07498786d80092843.tar.gz
Fixed false errors returned by logrotate script
Logrotate script assumed an error if mysqladmin failed to connect to server and there's mysqld process exists. However there can be non-system instance of mysqld running (e.g. in docker) making this assumption wrong. Check pid file existance instead.
Diffstat (limited to 'debian')
-rw-r--r--debian/mariadb-server-10.0.mysql-server.logrotate17
1 files changed, 5 insertions, 12 deletions
diff --git a/debian/mariadb-server-10.0.mysql-server.logrotate b/debian/mariadb-server-10.0.mysql-server.logrotate
index 789ad353e43..a19e9ec46a2 100644
--- a/debian/mariadb-server-10.0.mysql-server.logrotate
+++ b/debian/mariadb-server-10.0.mysql-server.logrotate
@@ -10,18 +10,11 @@
compress
sharedscripts
postrotate
- test -x /usr/bin/mysqladmin || exit 0
+ 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
+ if [ -f `my_print_defaults --mysqld | grep -oP "pid-file=\K[^$]+"` ]; then
+ # If this fails, check debian.conf!
+ mysqladmin --defaults-file=/etc/mysql/debian.cnf flush-logs
+ fi
endscript
}