Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-9769

solr stop on a service already stopped should return exit code 0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 6.3
    • None
    • scripts and tools
    • None

    Description

      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:

      $ /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
      
      "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
      
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jiri_pejchal Jiří Pejchal
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m