diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2015-04-07 11:38:50 +0300 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2015-04-07 11:38:50 +0300 |
commit | e3b58661b3b44440242c8dc7af25527aab54fa56 (patch) | |
tree | 5bd0ded2ebb1b8ec5cddc34ff13ee8fdc1b855f1 /tests | |
parent | 900b285419ac0234e47c07dfc79caeef091fbcb5 (diff) |
run_mysqld: stop: do nothing if no pid
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/local-server/run_mysqld | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/local-server/run_mysqld b/tests/local-server/run_mysqld index d705ca1..0ebe44b 100755 --- a/tests/local-server/run_mysqld +++ b/tests/local-server/run_mysqld @@ -54,7 +54,12 @@ init_mysql() { case "$1" in start) shift; run_mysqld "$@" &;; init) init_mysql;; -stop) kill `cat "$PID_FILE"`;; +stop) + pid=`cat "$PID_FILE" 2>/dev/null` + if [ "$pid" ]; then + kill $pid + fi + ;; restart) "$0" stop #sleep 1 |