diff options
author | James Meyer <james.meyer@operamail.com> | 2008-11-11 19:30:47 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2008-11-11 19:30:47 (GMT) |
commit | 9431f7ae609b0877b403bad9db39aed4df159229 (patch) | |
tree | ff95f8397492cb577d8c725f90cd9503d499d5a5 /abs/core-testing/runit-scripts/runitscripts/services/mysql | |
parent | df5646446d84f38b695f00706a57b4c851be462a (diff) | |
download | linhes_pkgbuild-9431f7ae609b0877b403bad9db39aed4df159229.zip linhes_pkgbuild-9431f7ae609b0877b403bad9db39aed4df159229.tar.gz linhes_pkgbuild-9431f7ae609b0877b403bad9db39aed4df159229.tar.bz2 |
move the runit init scripts into their own package.
Diffstat (limited to 'abs/core-testing/runit-scripts/runitscripts/services/mysql')
-rwxr-xr-x | abs/core-testing/runit-scripts/runitscripts/services/mysql/run | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/abs/core-testing/runit-scripts/runitscripts/services/mysql/run b/abs/core-testing/runit-scripts/runitscripts/services/mysql/run new file mode 100755 index 0000000..569230e --- /dev/null +++ b/abs/core-testing/runit-scripts/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 |