diff options
author | dirk <dirk@FreeBSD.org> | 2002-11-10 20:24:24 +0000 |
---|---|---|
committer | dirk <dirk@FreeBSD.org> | 2002-11-10 20:24:24 +0000 |
commit | f57c71b1ef568c1b83c4a908b941a12c8dfed1b2 (patch) | |
tree | be86fee7c25818b7ace400a2676a3214498a0ae4 /databases/mysql60-server/files | |
parent | e30bda0e8f25a992849c40794c820066b6cf526e (diff) | |
download | FreeBSD-ports-f57c71b1ef568c1b83c4a908b941a12c8dfed1b2.zip FreeBSD-ports-f57c71b1ef568c1b83c4a908b941a12c8dfed1b2.tar.gz |
Only kill mysqld we started. Don't kill all mysqld.
Submitted by: sobomax (modified by me a bit)
Diffstat (limited to 'databases/mysql60-server/files')
-rw-r--r-- | databases/mysql60-server/files/mysql-server.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/databases/mysql60-server/files/mysql-server.sh b/databases/mysql60-server/files/mysql-server.sh index 6cc4f30..f22cbd0 100644 --- a/databases/mysql60-server/files/mysql-server.sh +++ b/databases/mysql60-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 "" |