wok-current rev 25747
Listen to localhost for mariadb and fix init script
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Tue Feb 18 12:29:52 2025 +0000 (7 months ago) |
parents | 39ed7753e089 |
children | d4d07d6c4b5e |
files | mariadb/receipt mariadb/stuff/etc/init.d/mysql |
line diff
1.1 --- a/mariadb/receipt Tue Feb 18 09:18:19 2025 +0000 1.2 +++ b/mariadb/receipt Tue Feb 18 12:29:52 2025 +0000 1.3 @@ -67,14 +67,6 @@ 1.4 1.5 # Configuration file 1.6 cp -a $stuff/etc/init.d $fs/etc 1.7 - cp -a $src/support-files/my-medium.cnf $fs/etc/mysql/my.cnf 1.8 - cp -a $src/support-files/my-small.cnf $fs/etc/mysql 1.9 - grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \ 1.10 - 's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \ 1.11 - $fs/etc/mysql/my.cnf 1.12 - 1.13 - # Permissions 1.14 - chmod 600 $fs/etc/mysql/my.cnf 1.15 1.16 cat $stuff/*.files-list | while read file; do 1.17 [ -f $fs$file ] && rm -f $fs$file 1.18 @@ -100,6 +92,14 @@ 1.19 status 1.20 fi 1.21 1.22 + 1.23 + if ! grep -q ^MYSQL_OPTIONS "$1/etc/daemons.conf"; then 1.24 + echo '# Mariadb options.' >> "$1/etc/daemons.conf" 1.25 + echo 'MYSQL_OPTIONS="--bind-address=127.0.0.1 --pid-file=/var/run/mysqld/mysql.pid \ 1.26 + --datadir=/var/lib/mysql --user=mysql --socket=/var/run/mysqld/mysqld.sock"' >> "$1/etc/daemons.conf" 1.27 + echo '' >> "$1/etc/daemons.conf" 1.28 + fi 1.29 + 1.30 cat <<EOF 1.31 ---- 1.32 To start $PACKAGE server you can run :
2.1 --- a/mariadb/stuff/etc/init.d/mysql Tue Feb 18 09:18:19 2025 +0000 2.2 +++ b/mariadb/stuff/etc/init.d/mysql Tue Feb 18 12:29:52 2025 +0000 2.3 @@ -21,7 +21,7 @@ 2.4 fi 2.5 case "$1" in 2.6 start) 2.7 - if active_pidfile $PIDFILE mysqld ; then 2.8 + if active_pidfile $PIDFILE mariadbd ; then 2.9 _ '%s is already running.' $NAME 2.10 exit 1 2.11 fi 2.12 @@ -43,7 +43,7 @@ 2.13 done 2.14 ;; 2.15 stop) 2.16 - if ! active_pidfile $PIDFILE mysqld ; then 2.17 + if ! active_pidfile $PIDFILE mariadbd ; then 2.18 _ '%s is not running.' $NAME 2.19 exit 1 2.20 fi 2.21 @@ -53,7 +53,7 @@ 2.22 sleep 2 2.23 ;; 2.24 restart) 2.25 - if ! active_pidfile $PIDFILE mysqld ; then 2.26 + if ! active_pidfile $PIDFILE mariadbd ; then 2.27 _ '%s is not running.' $NAME 2.28 exit 1 2.29 fi