Commit ff002b9f authored by Fabio Montefuscolo's avatar Fabio Montefuscolo
Browse files

avoid tail on inexistent file

parent 1be9f674
Pipeline #3148 passed with stage
in 24 seconds
#!/bin/bash
MY_IP=$(hostname -i | awk '{ print $1 }')
if [ "$(basename $1)" != "mysqld" ];
then
exec "$@"
exit 0;
fi
touch "${MYSQL_LOG_FILE}"
chown mysql: "${MYSQL_LOG_FILE}"
chmod 666 "${MYSQL_LOG_FILE}"
tail -F "${MYSQL_LOG_FILE}" 2>/dev/null &
MY_IP=$(hostname -i | awk '{ print $1 }')
first_time=0
if [ -z "${CLUSTER_NAME}" ];
......@@ -88,24 +99,15 @@ then
done
fi
if [ "$(basename $1)" = "mysqld" ];
then
tail -F "${MYSQL_LOG_FILE}" 2>/dev/null &
set -- "$@" "--defaults-file=/etc/mysql/my.cnf"
set -- "$@" "--user=mysql"
set -- "$@" "--datadir=${PXC_DATA}"
set -- "$@" "--log-bin=$CLUSTER_NAME-bin"
set -- "$@" "--explicit_defaults_for_timestamp=on"
set -- "$@" "--wsrep_cluster_name=$CLUSTER_NAME"
set -- "$@" "--wsrep_sst_method=xtrabackup-v2"
set -- "$@" "--wsrep_cluster_address=gcomm://$online"
set -- "$@" "--wsrep_sst_auth=xtrabackup:$XTRABACKUP_PASSWORD"
set -- "$@" "--wsrep_node_address=$MY_IP"
echo "$@" >&2
exec "$@"
else
exec "$@"
fi
set -- "$@" "--defaults-file=/etc/mysql/my.cnf"
set -- "$@" "--user=mysql"
set -- "$@" "--datadir=${PXC_DATA}"
set -- "$@" "--log-bin=$CLUSTER_NAME-bin"
set -- "$@" "--explicit_defaults_for_timestamp=on"
set -- "$@" "--wsrep_cluster_name=$CLUSTER_NAME"
set -- "$@" "--wsrep_sst_method=xtrabackup-v2"
set -- "$@" "--wsrep_cluster_address=gcomm://$online"
set -- "$@" "--wsrep_sst_auth=xtrabackup:$XTRABACKUP_PASSWORD"
set -- "$@" "--wsrep_node_address=$MY_IP"
echo "$@" >&2
exec "$@"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment