diff options
Diffstat (limited to 'abs/core-testing/runit/runitscripts/services/mysql')
-rwxr-xr-x | abs/core-testing/runit/runitscripts/services/mysql/run | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/abs/core-testing/runit/runitscripts/services/mysql/run b/abs/core-testing/runit/runitscripts/services/mysql/run new file mode 100755 index 0000000..569230e --- /dev/null +++ b/abs/core-testing/runit/runitscripts/services/mysql/run @@ -0,0 +1,29 @@ +#!/bin/bash +exec 2>&1 + +MYSQLD_ROOT="/data/srv/mysql" +# source application-specific settings +[ -f /etc/conf.d/mysqld ] && . /etc/conf.d/mysqld +if [ ! `egrep '^mysql:' /etc/group` ]; then + stat_busy "Adding mysql group" + groupadd -g 89 mysql + stat_done +fi +if [ ! `egrep '^mysql:' /etc/passwd` ]; then + stat_busy "Adding mysql user" + useradd -u 89 -g mysql -d $MYSQLD_ROOT -s /bin/false mysql + [ -d $MYSQLD_ROOT ] && chown -R mysql.mysql $MYSQLD_ROOT + stat_done +fi + +if [ ! -d $MYSQLD_ROOT ]; then + mkdir $MYSQLD_ROOT + /usr/bin/mysql_install_db --datadir=$MYSQLD_ROOT --user=mysql + chown -R mysql.mysql $MYSQLD_ROOT +fi + +if [ ! -e /var/log/mysqld.log ]; then + touch /var/log/mysqld.log + chown mysql /var/log/mysqld.log +fi +exec /usr/sbin/mysqld -u mysql 2>/dev/null >/dev/null |