mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
Fixed problems with stop tentacle server, doen't stop all procesess. Tiquet: #3488
(cherry picked from commit 0210afa536d0d495aeead215d4c37a4a98dae442)
This commit is contained in:
parent
fdeb89f4f3
commit
8dbca91c6d
@ -51,6 +51,16 @@ function get_pid {
|
|||||||
echo $TENTACLE_PID
|
echo $TENTACLE_PID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_all_pid {
|
||||||
|
# This sets COLUMNS to XXX chars, because if command is run
|
||||||
|
# in a "strech" term, ps aux don't report more than COLUMNS
|
||||||
|
# characters and this will not work.
|
||||||
|
COLUMNS=300
|
||||||
|
TENTACLE_PIDS=`ps aux | grep "$TENTACLE_PATH$TENTACLE_DAEMON" | grep -v grep | awk '{ print $2 }'`
|
||||||
|
TENTACLE_PID="${TENTACLE_PIDS//\\n/' '}"
|
||||||
|
echo $TENTACLE_PID
|
||||||
|
}
|
||||||
|
|
||||||
# Pandora server settings
|
# Pandora server settings
|
||||||
PANDORA_SERVER_PATH="/var/spool/pandora/data_in"
|
PANDORA_SERVER_PATH="/var/spool/pandora/data_in"
|
||||||
|
|
||||||
@ -110,14 +120,14 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
stop)
|
stop)
|
||||||
TENTACLE_PID=`get_pid`
|
TENTACLE_PID=`get_all_pid`
|
||||||
if [ -z "$TENTACLE_PID" ]; then
|
if [ -z "$TENTACLE_PID" ]; then
|
||||||
echo "Tentacle Server does not seem to be running"
|
echo "Tentacle Server does not seem to be running"
|
||||||
rc_exit # running stop on a service already stopped or not running
|
rc_exit # running stop on a service already stopped or not running
|
||||||
else
|
else
|
||||||
kill $TENTACLE_PID
|
kill $TENTACLE_PID
|
||||||
sleep 1
|
sleep 1
|
||||||
_PID=`get_pid`
|
_PID=`get_all_pid`
|
||||||
|
|
||||||
if [ "$_PID" = "$TENTACLE_PID" ]; then
|
if [ "$_PID" = "$TENTACLE_PID" ]; then
|
||||||
echo "Tentacle Server could not be stopped"
|
echo "Tentacle Server could not be stopped"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user