summaryrefslogtreecommitdiffstats
path: root/databases/mysql55-server/files/mysql-server.sh
diff options
context:
space:
mode:
Diffstat (limited to 'databases/mysql55-server/files/mysql-server.sh')
-rw-r--r--databases/mysql55-server/files/mysql-server.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/databases/mysql55-server/files/mysql-server.sh b/databases/mysql55-server/files/mysql-server.sh
index 6cc4f30..f22cbd0 100644
--- a/databases/mysql55-server/files/mysql-server.sh
+++ b/databases/mysql55-server/files/mysql-server.sh
@@ -1,14 +1,21 @@
#!/bin/sh
+DB_DIR=%%DB_DIR%%
+PIDFILE=${DB_DIR}/`/bin/hostname -s`.pid
+
case "$1" in
start)
if [ -x %%PREFIX%%/bin/safe_mysqld ]; then
- %%PREFIX%%/bin/safe_mysqld --user=mysql > /dev/null &
+ %%PREFIX%%/bin/safe_mysqld --user=mysql --datadir=${DB_DIR} --pid-file=${PIDFILE} > /dev/null &
echo -n ' mysqld'
fi
;;
stop)
- /usr/bin/killall mysqld > /dev/null 2>&1 && echo -n ' mysqld'
+ if [ -f ${PIDFILE} ]; then
+ /bin/kill `cat ${PIDFILE}` > /dev/null 2>&1 && echo -n ' mysqld'
+ else
+ echo "mysql-server isn't running"
+ fi
;;
*)
echo ""
OpenPOWER on IntegriCloud