summaryrefslogtreecommitdiffstats
path: root/abs/core/runit/runitscripts/services/mysql
diff options
context:
space:
mode:
authorJames Meyer <James.meyer@operamail.com>2008-10-02 03:19:12 (GMT)
committerJames Meyer <James.meyer@operamail.com>2008-10-02 03:19:12 (GMT)
commit0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a (patch)
treec0aa2c0b53c317be87eacfcb77b63f53f1f415e7 /abs/core/runit/runitscripts/services/mysql
downloadlinhes_pkgbuild-0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a.zip
linhes_pkgbuild-0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a.tar.gz
linhes_pkgbuild-0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a.tar.bz2
initial import
Diffstat (limited to 'abs/core/runit/runitscripts/services/mysql')
-rwxr-xr-xabs/core/runit/runitscripts/services/mysql/run29
1 files changed, 29 insertions, 0 deletions
diff --git a/abs/core/runit/runitscripts/services/mysql/run b/abs/core/runit/runitscripts/services/mysql/run
new file mode 100755
index 0000000..569230e
--- /dev/null
+++ b/abs/core/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