]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[kea-packaging#8] hammer: stop mariadb before setup
authorAndrei Pavel <andrei@isc.org>
Tue, 13 Aug 2024 08:23:15 +0000 (11:23 +0300)
committerAndrei Pavel <andrei@isc.org>
Tue, 13 Aug 2024 08:23:15 +0000 (11:23 +0300)
Attempt to fix `start-stop-daemon: /usr/bin/mysqld_safe is already running`

hammer.py

index 2d583427c061195742d5da9350b431a9c72dd05c..4838ecda125d16899d4a59032846ab9af4b94642 100755 (executable)
--- a/hammer.py
+++ b/hammer.py
@@ -1370,17 +1370,9 @@ ssl_key = {cert_dir}/kea-client.key
     elif system == 'alpine':
         execute('sudo sed -i "/^skip-networking$/d" /etc/my.cnf.d/mariadb-server.cnf')
         execute('sudo rc-update add mariadb')
-        execute('sudo /etc/init.d/mariadb setup', raise_error=False)
-
-        # Wait for setup command to complete.
-        for i in range(10):
-            exit_code = execute('sudo pidof mysqld_safe', raise_error=False)
-            if exit_code != 0:
-                # Process exited or there was no process to begin with.
-                break
-            time.sleep(1)
-
-        execute('sudo /etc/init.d/mariadb restart')
+        execute('sudo rc-service mariadb stop')
+        execute('sudo rc-service mariadb setup')
+        execute('sudo rc-service mariadb restart')
 
     cmd = "echo 'DROP DATABASE IF EXISTS keatest;' | sudo mysql -u root"
     execute(cmd)