aboutsummaryrefslogtreecommitdiff
path: root/package/mysql
diff options
context:
space:
mode:
authorGravatar Eloi BAIL <eloi.bail@savoirfairelinux.com>2016-10-13 14:28:02 -0400
committerGravatar Peter Korsgaard <peter@korsgaard.com>2016-10-15 11:21:27 +0200
commite278c5201251f0fb25d17cfb9e1a443a17a5f54d (patch)
treef7701486d1567ebe70bebd279952f0da6e9fcb15 /package/mysql
parentd61b8de0b09515c7927e6c93c14741d8aa4e4d70 (diff)
downloadbuildroot-e278c5201251f0fb25d17cfb9e1a443a17a5f54d.tar.gz
buildroot-e278c5201251f0fb25d17cfb9e1a443a17a5f54d.tar.bz2
mysql: Make S97mysqld source a default file
Hardcoded parameters are used for mysql user/directory. Make S97mysqld source a /etc/default/mysql file where these parameters can be overridden. Signed-off-by: Eloi BAIL <eloi.bail@savoirfairelinux.com> Tested-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'package/mysql')
-rw-r--r--package/mysql/S97mysqld9
1 files changed, 7 insertions, 2 deletions
diff --git a/package/mysql/S97mysqld b/package/mysql/S97mysqld
index 5a660e9424..110ca2cd12 100644
--- a/package/mysql/S97mysqld
+++ b/package/mysql/S97mysqld
@@ -1,10 +1,15 @@
#!/bin/sh
+MYSQL_DIR="/var/mysql"
+MYSQL_USER="mysql"
+
+[ -r /etc/default/mysql ] && . /etc/default/mysql
+
case "$1" in
start)
- if [ ! -d /var/mysql/mysql ] ; then
+ if [ ! -d $MYSQL_DIR/mysql ] ; then
echo "Creating MySQL system tables..."
- mysql_install_db --user=mysql --ldata=/var/mysql
+ mysql_install_db --user=$MYSQL_USER --ldata=$MYSQL_DIR
fi
# mysqld runs as user mysql, but /run is only writable by root