wok-next rev 1147
mysql: init database in /etc/init.d/mysql, not post_install
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Jul 26 13:40:35 2008 +0000 (2008-07-26) |
parents | b4f5dca41cf5 |
children | 14dc2f353733 |
files | mysql/receipt mysql/stuff/etc/init.d/mysql |
line diff
1.1 --- a/mysql/receipt Fri Jul 25 22:27:52 2008 +0000 1.2 +++ b/mysql/receipt Sat Jul 26 13:40:35 2008 +0000 1.3 @@ -34,6 +34,7 @@ 1.4 cp -a $_pkg/usr/libexec $fs/usr 1.5 cp -a $_pkg/usr/share/mysql $fs/usr/share 1.6 cp -a $src/support-files/my-medium.cnf $fs/etc/my.cnf 1.7 + chmod 600 $fs/etc/my.cnf 1.8 cp -a stuff/etc/init.d $fs/etc 1.9 cat $src/*.files-list | while read file; do 1.10 [ -f $fs$file ] && rm -f $fs$file 1.11 @@ -61,7 +62,15 @@ 1.12 status 1.13 fi 1.14 chroot $1/ chown mysql.mysql $(cat $1/$INSTALLED/$PACKAGE/files.list) 1.15 - chroot $1/ mysql_install_db --user=mysql --datadir=/var/lib/mysql 1.16 + cat <<EOF 1.17 +---- 1.18 +To start $PACKAGE server you can run : 1.19 + 1.20 + /etc/init.d/$PACKAGE start 1.21 + 1.22 +Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf 1.23 +---- 1.24 +EOF 1.25 } 1.26 1.27 post_remove()
2.1 --- a/mysql/stuff/etc/init.d/mysql Fri Jul 25 22:27:52 2008 +0000 2.2 +++ b/mysql/stuff/etc/init.d/mysql Sat Jul 26 13:40:35 2008 +0000 2.3 @@ -21,6 +21,11 @@ 2.4 echo "$NAME already running." 2.5 exit 1 2.6 fi 2.7 + if [ ! -d /var/lib/mysql/mysql ]; then 2.8 + echo "Initializing $DESC: " 2.9 + rm -rf /var/lib/mysql/* 2> /dev/null 2.10 + mysql_install_db --user=mysql --datadir=/var/lib/mysql 2.11 + fi 2.12 echo -n "Starting $DESC: $NAME... " 2.13 $DAEMON $OPTIONS & 2.14 status