Merge pull request #1549 from SteveGilvarry/initd_sql_wait

Implement suggested wait for MySQL start
This commit is contained in:
Andrew Bauer 2016-08-06 09:14:58 -05:00 committed by GitHub
commit 6c8001f362
1 changed files with 7 additions and 0 deletions

View File

@ -23,6 +23,13 @@ command="$ZM_PATH_BIN/zmpkg.pl"
start() {
echo -n "Starting $prog: "
# Wait for mysqld to start. Continue if it takes too long.
count=0
while [ ! -e /var/run/mysqld/mysqld.sock ] && [ $count -lt 60 ]
do
sleep 1
count=$((count+1))
done
export TZ=:/etc/localtime
mkdir -p "$RUNDIR" && chown www-data:www-data "$RUNDIR"
mkdir -p "$TMPDIR" && chown www-data:www-data "$TMPDIR"