You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Logging is done by calling _note, _warn or _error with the message string.
_warn and _error print to stderr, and _error causes the script to exit with
return code 1
$datestring [ERROR] [Entrypoint]: mysqld failed while attempting to check config
68
-
command was: "${toRun[*]}"
69
-
70
-
$errors
71
-
EOM
72
-
exit 1
79
+
_error "mysqld failed while attempting to check config\n\tcommand was: ${toRun[*]}\n\t$errors"
73
80
fi
74
81
}
75
82
@@ -97,8 +104,7 @@ _start_server() {
97
104
sleep 1
98
105
done
99
106
if [ "$i"= 0 ];then
100
-
echo>&2"$(date --rfc-3339=seconds) [ERROR] [Entrypoint]: Unable to start server."
101
-
exit 1
107
+
_error "Unable to start server."
102
108
fi
103
109
return$pid
104
110
}
@@ -113,8 +119,7 @@ _stop_server() {
113
119
fi
114
120
done
115
121
# The server hasn't shut down in a timely manner
116
-
echo"$(date --rfc-3339=seconds) [ERROR] [Entrypoint]: Unable to shut down server with process id $server_pid">&2
117
-
return 1
122
+
_error "Unable to shut down server with process id $server_pid"
118
123
119
124
}
120
125
# allow the container to be started with `--user`
@@ -135,28 +140,26 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
135
140
if [ !-d"$DATADIR/mysql" ];then
136
141
file_env 'MYSQL_ROOT_PASSWORD'
137
142
if [ -z"$MYSQL_ROOT_PASSWORD"-a-z"$MYSQL_ALLOW_EMPTY_PASSWORD"-a-z"$MYSQL_RANDOM_ROOT_PASSWORD" ];then
138
-
echo>&2"$(date --rfc-3339=seconds) [ERROR] [Entrypoint]: Database is uninitialized and password option is not specified "
139
-
echo>&2"$(date --rfc-3339=seconds) [ERROR] [Entrypoint]: You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD"
140
-
exit 1
143
+
_error "Database is uninitialized and password option is not specified \n\tYou need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD"
0 commit comments