lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jiri Pejchal (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SOLR-9769) solr stop on a service already stopped should return exit code 0
Date Thu, 25 Apr 2019 00:40:00 GMT

    [ https://issues.apache.org/jira/browse/SOLR-9769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16825609#comment-16825609
] 

Jiri Pejchal commented on SOLR-9769:
------------------------------------

Let's say you have  some kind of restart script that exits on first error. The script stops
solr, does something, starts solr. When solr is not running this script fails and does not
start solr again.
{code}
#!/bin/bash
set -e
/etc/init.d/solr stop
# do something
/etc/init.d/solr start
{code}

Calling service {{stop}} on already stopped solr should return success status - zero (instead
of the currently returned error status - one). 
Calling {{restart}} already returns zero even if solr is not running.

> solr stop on a service already stopped should return exit code 0
> ----------------------------------------------------------------
>
>                 Key: SOLR-9769
>                 URL: https://issues.apache.org/jira/browse/SOLR-9769
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: scripts and tools
>    Affects Versions: 6.3
>            Reporter: Jiří Pejchal
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> According to the LSB specification
> https://refspecs.linuxfoundation.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic.html#INISCRPTACT
>  running stop on a service already stopped or not running should be considered successful
and return code should be 0 (zero).
> Solr currently returns exit code 1:
> {code}
> $ /etc/init.d/solr stop; echo $?
> Sending stop command to Solr running on port 8983 ... waiting up to 180 seconds to allow
Jetty process 4277 to stop gracefully.
> 0
> $ /etc/init.d/solr stop; echo $?
> No process found for Solr node running on port 8983
> 1
> {code}
> {code:title="bin/solr"}
> if [ "$SOLR_PID" != "" ]; then
>     stop_solr "$SOLR_SERVER_DIR" "$SOLR_PORT" "$STOP_KEY" "$SOLR_PID"
>   else
>     if [ "$SCRIPT_CMD" == "stop" ]; then
>       echo -e "No process found for Solr node running on port $SOLR_PORT"
>       exit 1
>     fi
>   fi
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message