Skip to content

Commit 64fddf7

Browse files
committed
[#3470] unrelated: wait for "mariadb setup"/mysqld_safe to complete before restarting mariadb in alpine
Attempt to fix `start-stop-daemon: /usr/bin/mysqld_safe is already running`
1 parent 04bd5f6 commit 64fddf7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

hammer.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,6 +1371,15 @@ def _configure_mysql(system, revision, features):
13711371
execute('sudo sed -i "/^skip-networking$/d" /etc/my.cnf.d/mariadb-server.cnf')
13721372
execute('sudo rc-update add mariadb')
13731373
execute('sudo /etc/init.d/mariadb setup', raise_error=False)
1374+
1375+
# Wait for setup command to complete.
1376+
for i in range(10):
1377+
exit_code = execute('sudo pidof mysqld_safe', raise_error=False)
1378+
if exit_code != 0:
1379+
# Process exited or there was no process to begin with.
1380+
break
1381+
time.sleep(1)
1382+
13741383
execute('sudo /etc/init.d/mariadb restart')
13751384

13761385
cmd = "echo 'DROP DATABASE IF EXISTS keatest;' | sudo mysql -u root"

0 commit comments

Comments
 (0)