summaryrefslogtreecommitdiff
path: root/scripts/mysqld_safe.sh
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@skysql.com>2014-07-15 01:01:49 -0400
committerNirbhay Choubey <nirbhay@skysql.com>2014-07-15 01:01:49 -0400
commiteaa0fe7cf859ad822f71bbaa2a47b23b4963ba9d (patch)
tree5f994923c51f83536e9c87c1e839475cc0664ea0 /scripts/mysqld_safe.sh
parentb77fc5a34327de0bfa0c8a75e55726dfc3b2fd21 (diff)
downloadmariadb-git-eaa0fe7cf859ad822f71bbaa2a47b23b4963ba9d.tar.gz
MDEV-4728: local merge from maria-5.5-galera.
Diffstat (limited to 'scripts/mysqld_safe.sh')
-rw-r--r--scripts/mysqld_safe.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index 33b1300492f..e7eb2e72cbd 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -229,8 +229,19 @@ wsrep_recover_position() {
local wr_logfile=$(mktemp $DATADIR/wsrep_recovery.XXXXXX)
- [ "$euid" = "0" ] && chown $user $wr_logfile
- chmod 600 $wr_logfile
+ # safety checks
+ if [ -z $wr_logfile ]; then
+ log_error "WSREP: mktemp failed"
+ return 1
+ fi
+
+ if [ -f $wr_logfile ]; then
+ [ "$euid" = "0" ] && chown $user $wr_logfile
+ chmod 600 $wr_logfile
+ else
+ log_error "WSREP: mktemp failed"
+ return 1
+ fi
local wr_pidfile="$DATADIR/"`@HOSTNAME@`"-recover.pid"