[
https://issues.apache.org/jira/browse/CASSANDRA-8738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14305578#comment-14305578
]
Donald Smith commented on CASSANDRA-8738:
-----------------------------------------
I'm using 2.0.11. But I see that 2.1.1 has the same problem. It looks like
3.0's version at https://github.com/apache/cassandra/blob/trunk/debian/init
fixes it:
{noformat}
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon -K -p "$PIDFILE" -R TERM/30/KILL/5 >/dev/null
RET=$?
rm -f "$PIDFILE"
return $RET
}
{noformat}
> "/etc/init.d/cassandra stop" prints OK even when it doesn't work
> ----------------------------------------------------------------
>
> Key: CASSANDRA-8738
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8738
> Project: Cassandra
> Issue Type: Improvement
> Reporter: Donald Smith
>
> Sometimes I do {{/etc/init.d/cassandra stop}} and it prints out OK, but the
> server is still running. (This happens, for example, if it's busy doing
> GCs.) The current init script prints out OK after sleeping but without
> checking if the process really stopped. I suggest changing it to:
> {noformat}
> pd0-cassandra16 ~> diff -C 1 cassandra cassandra-original
> *** cassandra 2015-02-04 09:15:58.088209988 -0800
> --- cassandra-original 2015-02-04 09:15:40.293767501 -0800
> ***************
> *** 69,77 ****
> sleep 5
> ! THE_STATUS=`$0 status`
> ! if [[ $THE_STATUS == *"stopped"* ]]
> ! then
> ! echo "OK"
> ! else
> ! echo "ERROR: could not stop the process: $THE_STATUS"
> ! exit 1
> ! fi
> ;;
> --- 69,71 ----
> sleep 5
> ! echo "OK"
> ;;
> {noformat}
> Then it prints out OK only if the stop succeeded. Otherwise it prints out a
> message like
> {quote}
> ERROR: could not stop the process: cassandra (pid 10764) is running...
> {quote}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)