Solr
  1. Solr
  2. SOLR-8401

Windows start script fails when executed from a different drive

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 5.3.1
    • Fix Version/s: 5.5, 6.0
    • Component/s: scripts and tools
    • Labels:
      None
    • Environment:

      Windows

      Description

      The windows start script (bin/solr.cmd) changes the current directory to the SOLR_SERVER_DIR before executing "java -jar start.jar":

      cd "%SOLR_SERVER_DIR%"
      

      If the solr.cmd script is executed from a different drive, the "cd" doesn't really change the directory and the java process doesn't start ("Unable to access jarfile start.jar")
      It should be replaced by the following line in order to work from any location:

      cd /d "%SOLR_SERVER_DIR%"
      
      1. SOLR-8401.patch
        0.9 kB
        Erick Erickson
      2. SOLR-8401.patch
        0.4 kB
        Erick Erickson

        Activity

        Hide
        Erick Erickson added a comment -

        Here's a patch, I don't have a multi-drive Windows setup, but change doesn't seem to hurt the single-drive.

        Could you give it a spin and I'll commit it if it works for you?

        Show
        Erick Erickson added a comment - Here's a patch, I don't have a multi-drive Windows setup, but change doesn't seem to hurt the single-drive. Could you give it a spin and I'll commit it if it works for you?
        Hide
        Uwe Schindler added a comment -

        LGTM

        Show
        Uwe Schindler added a comment - LGTM
        Hide
        Nicolas Gavalda added a comment -

        The change works on our windows environments, thank you.

        Show
        Nicolas Gavalda added a comment - The change works on our windows environments, thank you.
        Hide
        Erick Erickson added a comment -

        Same patch with CHANGES.txt entry.

        Show
        Erick Erickson added a comment - Same patch with CHANGES.txt entry.
        Hide
        ASF subversion and git services added a comment -

        Commit 1719123 from Erick Erickson in branch 'dev/trunk'
        [ https://svn.apache.org/r1719123 ]

        SOLR-8401: Windows start script fails when executed from a different drive

        Show
        ASF subversion and git services added a comment - Commit 1719123 from Erick Erickson in branch 'dev/trunk' [ https://svn.apache.org/r1719123 ] SOLR-8401 : Windows start script fails when executed from a different drive
        Hide
        ASF subversion and git services added a comment -

        Commit 1719125 from Erick Erickson in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1719125 ]

        SOLR-8401: Windows start script fails when executed from a different drive

        Show
        ASF subversion and git services added a comment - Commit 1719125 from Erick Erickson in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1719125 ] SOLR-8401 : Windows start script fails when executed from a different drive
        Hide
        Erick Erickson added a comment -

        Thanks Nicolas for providing the fix and both you and Uwe for checking!

        Show
        Erick Erickson added a comment - Thanks Nicolas for providing the fix and both you and Uwe for checking!

          People

          • Assignee:
            Erick Erickson
            Reporter:
            Nicolas Gavalda
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development