Try to solve the MySQL startup failure caused by the permission problem caused by the MySQL user's uid change.

This commit is contained in:
Hulk 2019-01-30 10:10:57 +01:00
parent fd773002aa
commit ebe4070534

View file

@ -265,17 +265,17 @@ def update_version_stamp(version, fn=get_version_stamp_file()):
fp.write(version + '\n')
def wait_for_mysql():
try_one = 1
tried = False
while not exists('/var/run/mysqld/mysqld.sock'):
logdbg('waiting for mysql server to be ready')
time.sleep(2)
"""
Try to solve the MySQL startup failure caused by the permission problem
caused by the MySQL user's uid change.
"""
if try_one != 0:
os.system('rm /var/lib/mysql/tc.log -f && chown -R mysql.mysql /var/lib/mysql/')
try_one -= 1
if not tried:
os.system('rm /var/lib/mysql/tc.log -f && chown -R mysql.mysql /var/lib/mysql/')
tried = True
time.sleep(2)
logdbg('mysql server is ready')
def wait_for_nginx():