|
@@ -4,6 +4,7 @@ if [ ! -d /run/mysqld ]; then
|
4
|
4
|
echo "/run/mysqld not found so creating one"
|
5
|
5
|
mkdir -p /run/mysqld
|
6
|
6
|
fi
|
|
7
|
+echo "ensuring /run/mysqld permissions"
|
7
|
8
|
chown mysql:mysql /run/mysqld
|
8
|
9
|
|
9
|
10
|
if [ /etc/my.cnf.d/mariadb-server.cnf ]; then
|
|
@@ -30,7 +31,7 @@ if [ ! -d $DATADIR ]; then
|
30
|
31
|
if echo 'SELECT 1' | mysql &> /dev/null; then
|
31
|
32
|
break
|
32
|
33
|
fi
|
33
|
|
- echo 'MySQL init process in progress...'
|
|
34
|
+ echo 'MariaDB init process in progress...'
|
34
|
35
|
sleep 5
|
35
|
36
|
done
|
36
|
37
|
|
|
@@ -38,27 +39,9 @@ if [ ! -d $DATADIR ]; then
|
38
|
39
|
cat /tmp/dbinit.sql | mysql
|
39
|
40
|
|
40
|
41
|
if ! kill -s TERM "$pid" || ! wait "$pid"; then
|
41
|
|
- echo >&2 'MySQL init process failed.'
|
|
42
|
+ echo >&2 'MariaDB init process failed.'
|
42
|
43
|
exit 1
|
43
|
44
|
fi
|
44
|
45
|
|
45
|
46
|
rm /tmp/dbinit.sql
|
46
|
47
|
fi
|
47
|
|
-
|
48
|
|
-su-exec mysql:mysql mysqld --bind-address=127.0.0.1 --datadir=$DATADIR &
|
49
|
|
-pid="$!"
|
50
|
|
-
|
51
|
|
-for i in {30..0}; do
|
52
|
|
- if echo 'SELECT 1' | mysql &> /dev/null; then
|
53
|
|
- break
|
54
|
|
- fi
|
55
|
|
- echo 'MySQL init process in progress...'
|
56
|
|
- sleep 5
|
57
|
|
-done
|
58
|
|
-
|
59
|
|
-mysql_upgrade
|
60
|
|
-
|
61
|
|
-if ! kill -s TERM "$pid" || ! wait "$pid"; then
|
62
|
|
- echo >&2 'MySQL upgrade process failed.'
|
63
|
|
- exit 1
|
64
|
|
-fi
|