wok rev 12033
mysql: fix perms on /var/run/mysqld
author | Eric Joseph-Alexandre <erjo@slitaz.org> |
---|---|
date | Wed Mar 07 01:21:49 2012 +0100 (2012-03-07) |
parents | 411b8a4fa441 |
children | 94050984820c |
files | mysql/receipt |
line diff
1.1 --- a/mysql/receipt Wed Mar 07 00:09:31 2012 +0100 1.2 +++ b/mysql/receipt Wed Mar 07 01:21:49 2012 +0100 1.3 @@ -8,12 +8,13 @@ 1.4 TARBALL="$PACKAGE-$VERSION.tar.gz" 1.5 WEB_SITE="http://www.mysql.com/" 1.6 WGET_URL="http://mirrors.sunsite.dk/mysql/Downloads/MySQL-5.1/$TARBALL" 1.7 -DEPENDS="busybox libmysqlclient mysql-client zlib slitaz-base-files \ 1.8 -gcc-lib-base" 1.9 CONFIG_FILES="/etc/mysql/my.cnf" 1.10 DATABASE_FILES="/var/lib/mysql" 1.11 CROSS="bug: can not run test programm" 1.12 1.13 +DEPENDS="busybox libmysqlclient mysql-client zlib slitaz-base-files \ 1.14 +gcc-lib-base" 1.15 + 1.16 # Rules to configure and make the package. 1.17 compile_rules() 1.18 { 1.19 @@ -36,7 +37,7 @@ 1.20 --build=$HOST_SYSTEM \ 1.21 --host=$HOST_SYSTEM && 1.22 make $MAKEFLAGS && 1.23 - make DESTDIR=$DESTDIR install 1.24 + make install 1.25 } 1.26 1.27 # Rules to gen a SliTaz package suitable for Tazpkg. 1.28 @@ -50,13 +51,13 @@ 1.29 $fs/var/lib/mysql \ 1.30 $fs/var/run/mysqld 1.31 1.32 - cp -a $_pkg/usr/bin $fs/usr 1.33 - cp -a $_pkg/usr/sbin $fs/usr 1.34 - cp -a $_pkg/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin 1.35 - cp -a $_pkg/usr/share/mysql $fs/usr/share 1.36 + cp -a $install/usr/bin $fs/usr 1.37 + cp -a $install/usr/sbin $fs/usr 1.38 + cp -a $install/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin 1.39 + cp -a $install/usr/share/mysql $fs/usr/share 1.40 1.41 # Configuration file 1.42 - cp -a stuff/etc/init.d $fs/etc 1.43 + cp -a $stuff/etc/init.d $fs/etc 1.44 cp -a $src/support-files/my-medium.cnf $fs/etc/mysql/my.cnf 1.45 cp -a $src/support-files/my-small.cnf $fs/etc/mysql 1.46 grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \ 1.47 @@ -75,21 +76,22 @@ 1.48 # Pre and post install commands for Tazpkg. 1.49 post_install() 1.50 { 1.51 - # addgroup mysql if needed 1.52 - if ! grep -q mysql $1/etc/group; then 1.53 - echo -n "Adding group MySQL..." 1.54 - chroot $1/ /bin/addgroup -g 27 mysql 1.55 + 1.56 + local user 1.57 + local group 1.58 + 1.59 + user=mysql 1.60 + group=mysql 1.61 + 1.62 + if ! grep -q $user $1/etc/passwd; then 1.63 + echo -n "Adding user/group $user..." 1.64 + chroot $1/ addgroup -S $group 1.65 + chroot $1/ adduser -s /bin/false -S -D -H -G $group $user 1.66 status 1.67 fi 1.68 - # adduser mysql if needed 1.69 - if ! grep -q mysql $1/etc/passwd; then 1.70 - echo -n "Adding user MySQL..." 1.71 - chroot $1/ /bin/adduser -s /bin/false -h /dev/null \ 1.72 - -g "MySQL Daemon user" -u 27 -H -D -S -G mysql mysql 1.73 - status 1.74 - fi 1.75 - #chroot $1/ /bin/chown mysql.mysql $(cat $1/$INSTALLED/$PACKAGE/files.list) 1.76 - chroot $1/ /bin/chown -R mysql.mysql $1/var/lib/mysql $1/var/run/mysqld 1.77 + 1.78 + chroot $1/ chown -R ${user}.${group} /var/lib/mysql /var/run/mysqld 1.79 + 1.80 cat <<EOF 1.81 ---- 1.82 To start $PACKAGE server you can run : 1.83 @@ -111,5 +113,6 @@ 1.84 1.85 post_remove() 1.86 { 1.87 + echo "Removing user/group squid" 1.88 deluser mysql 1.89 }