[arch-commits] Commit in mysql/trunk (mysql.install)
Andrea Scarpino
andrea at archlinux.org
Tue Mar 23 17:07:02 UTC 2010
Date: Tuesday, March 23, 2010 @ 13:07:01
Author: andrea
Revision: 73173
fix custom MYSQLD_ROOT
Modified:
mysql/trunk/mysql.install
---------------+
mysql.install | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
Modified: mysql.install
===================================================================
--- mysql.install 2010-03-23 17:04:29 UTC (rev 73172)
+++ mysql.install 2010-03-23 17:07:01 UTC (rev 73173)
@@ -1,17 +1,20 @@
+MYSQLD_ROOT="/var/lib/mysql"
+
post_install(){
groupadd -g 89 mysql &>/dev/null
- useradd -u 89 -g mysql -d /var/lib/mysql -s /bin/false mysql &>/dev/null
- usr/bin/mysql_install_db --datadir=/var/lib/mysql --user=mysql
- chown -R mysql:mysql var/lib/mysql &> /dev/null
+ useradd -u 89 -g mysql -d ${MYSQLD_ROOT} -s /bin/false mysql &>/dev/null
+ usr/bin/mysql_install_db --datadir=${MYSQLD_ROOT#/} --user=mysql
+ chown -R mysql:mysql ${MYSQLD_ROOT#/} &> /dev/null
}
post_upgrade(){
- getent group mysql >/dev/null 2>&1 || groupadd -g 89 mysql
- getent passwd mysql >/dev/null 2>&1 || useradd -u 89 -g mysql -d /var/lib/mysql -s /bin/false mysql
- chown -R mysql:mysql var/lib/mysql &> /dev/null
+ [ -f etc/mysql/mysql.conf ] && source etc/mysql/mysql.conf &>/dev/null
+ getent group mysql >/dev/null 2>&1 || groupadd -g 89 mysql &>/dev/null
+ getent passwd mysql >/dev/null 2>&1 || useradd -u 89 -g mysql -d ${MYSQLD_ROOT} -s /bin/false mysql &>/dev/null
+ chown -R mysql:mysql ${MYSQLD_ROOT#/} &> /dev/null
}
post_remove(){
- getent passwd mysql >/dev/null 2>&1 && userdel mysql &> /dev/null
- getent group mysql >/dev/null 2>&1 && groupdel mysql &> /dev/null
+ getent passwd mysql >/dev/null 2>&1 && userdel mysql &>/dev/null
+ getent group mysql >/dev/null 2>&1 && groupdel mysql &>/dev/null
}
More information about the arch-commits
mailing list