Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
open-source
docker-pxc
Commits
ff002b9f
Commit
ff002b9f
authored
Feb 27, 2018
by
Fabio Montefuscolo
Browse files
avoid tail on inexistent file
parent
1be9f674
Pipeline
#3148
passed with stage
in 24 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
22 deletions
+24
-22
entrypoint/main.sh
entrypoint/main.sh
+24
-22
No files found.
entrypoint/main.sh
View file @
ff002b9f
#!/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
"
$@
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment