nixos/mysql: drop services.mysql.pidDir
mysql already has its socket path hardcoded to to /run/mysqld/mysqld.sock. There's not much value in making the pidDir configurable, which also points to /run/mysqld by default. We only seem to use `services.mysql.pidDir` in the wordpress startup script, to wait for mysql to boot up, but we can also simply wait on the (hardcoded) socket location too. A much nicer way to accomplish that would be to properly describe a dependency on mysqld.service. This however is not easily doable, due to how the apache-httpd module was designed.
This commit is contained in:
@@ -273,7 +273,7 @@ in
|
||||
if [ ! -d ${serverInfo.fullConfig.services.mysql.dataDir}/${config.dbName} ]; then
|
||||
echo "Need to create the database '${config.dbName}' and grant permissions to user named '${config.dbUser}'."
|
||||
# Wait until MySQL is up
|
||||
while [ ! -e ${serverInfo.fullConfig.services.mysql.pidDir}/mysqld.pid ]; do
|
||||
while [ ! -S /run/mysqld/mysqld.sock ]; do
|
||||
sleep 1
|
||||
done
|
||||
${pkgs.mysql}/bin/mysql -e 'CREATE DATABASE ${config.dbName};'
|
||||
|
||||
Reference in New Issue
Block a user