From ff01d9ec90116f0150c1b8116739d2dd0739dd6e Mon Sep 17 00:00:00 2001 From: hkosaka Date: Mon, 8 Apr 2013 03:09:05 +0000 Subject: [PATCH] 2013-04-08 Hirofumi Kosaka * util/pandora_server: Small improvement. Pinned target process id to be killed when stopping Pandora Server, to avoid to kill other processes that could be invoked in different session by chance. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7939 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 7 +++++++ pandora_server/util/pandora_server | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index ff37e66973..093dbc625d 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,10 @@ +2013-04-08 Hirofumi Kosaka + + * util/pandora_server: Small improvement. Pinned target + process id to be killed when stopping Pandora Server, to avoid + to kill other processes that could be invoked in different + session by chance. + 2013-04-07 Junichi Satoh * Makefile.PL: Changed library installation path for NetBSD. diff --git a/pandora_server/util/pandora_server b/pandora_server/util/pandora_server index 9fb1c8b94f..7b0a69f4dc 100755 --- a/pandora_server/util/pandora_server +++ b/pandora_server/util/pandora_server @@ -108,8 +108,8 @@ case "$1" in while [ $COUNTER -lt $MAXWAIT ] do - PANDORA_PID=`pidof_pandora` - if [ -z "$PANDORA_PID" ] + _PID=`pidof_pandora` + if [ "$_PID" != "$PANDORA_PID" ] then COUNTER=$MAXWAIT fi @@ -119,7 +119,7 @@ case "$1" in # Send a KILL -9 signal to process, if it's alive after 60secs, we need # to be sure is really dead, and not pretending... - if [ ! -z "$PANDORA_PID" ] + if [ "$_PID" = "$PANDORA_PID" ] then kill -9 $PANDORA_PID > /dev/null 2>&1 fi