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

Install script should check existence of tools, and add option to NOT start service

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.3, 7.0
    • Component/s: scripts and tools
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None

      Description

      The install_solr_service.sh script should exit cleanly if tools like tar, unzip, service or java are not available.

      Also, add a new switch -n to skip starting the service after installation, which will make it easier to script installations which will want to modify /etc/default/solr.in.sh before starting the service.

      1. SOLR-9508.patch
        3 kB
        Jan Høydahl

        Issue Links

          Activity

          Hide
          janhoy Jan Høydahl added a comment -

          Simple patch, which applies on top of SOLR-9475. Exits if tar/unzip/service/java unavailable and asks user to install the missing tool first.

          Complains but does not exit if lsof is missing.

          If switch -n is given, service is not started after install, and we do not exit if java is not found. This allows for Solr to be installed before Java.

          The java check is not more sophisticated than requiring "java" on path. We could start looking for it elsewhere, test the one in JAVA_HOME, validate that we have Java8 etc. I can be persuaded into skipping the java test since we do not need Java for the installer, and Solr will run as the "solr" user, not root. Still, lack of java in path for root user is a strong indication that it will probably not be present by default in the newly created solr user either, and service start will fail...

          Show
          janhoy Jan Høydahl added a comment - Simple patch, which applies on top of SOLR-9475 . Exits if tar/unzip/service/java unavailable and asks user to install the missing tool first. Complains but does not exit if lsof is missing. If switch -n is given, service is not started after install, and we do not exit if java is not found. This allows for Solr to be installed before Java. The java check is not more sophisticated than requiring "java" on path. We could start looking for it elsewhere, test the one in JAVA_HOME, validate that we have Java8 etc. I can be persuaded into skipping the java test since we do not need Java for the installer, and Solr will run as the "solr" user, not root. Still, lack of java in path for root user is a strong indication that it will probably not be present by default in the newly created solr user either, and service start will fail...
          Hide
          janhoy Jan Høydahl added a comment -

          Will commit this shortly if lazy consensus

          Show
          janhoy Jan Høydahl added a comment - Will commit this shortly if lazy consensus
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit b894ab292d3f319d03f375fc04376fbee6760b3f in lucene-solr's branch refs/heads/master from Jan Høydahl
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=b894ab2 ]

          SOLR-9508: Install script should check existence of tools, and add option to NOT start service

          Show
          jira-bot ASF subversion and git services added a comment - Commit b894ab292d3f319d03f375fc04376fbee6760b3f in lucene-solr's branch refs/heads/master from Jan Høydahl [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=b894ab2 ] SOLR-9508 : Install script should check existence of tools, and add option to NOT start service
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 33874f9ece1bafc2952f546d22c43998cbd43806 in lucene-solr's branch refs/heads/branch_6x from Jan Høydahl
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=33874f9 ]

          SOLR-9508: Install script should check existence of tools, and add option to NOT start service

          (cherry picked from commit b894ab2)

          Show
          jira-bot ASF subversion and git services added a comment - Commit 33874f9ece1bafc2952f546d22c43998cbd43806 in lucene-solr's branch refs/heads/branch_6x from Jan Høydahl [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=33874f9 ] SOLR-9508 : Install script should check existence of tools, and add option to NOT start service (cherry picked from commit b894ab2)
          Show
          janhoy Jan Høydahl added a comment - Updated refGuide: https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=50856198&selectedPageVersions=48&selectedPageVersions=47
          Hide
          shalinmangar Shalin Shekhar Mangar added a comment -

          Closing after 6.3.0 release.

          Show
          shalinmangar Shalin Shekhar Mangar added a comment - Closing after 6.3.0 release.

            People

            • Assignee:
              janhoy Jan Høydahl
              Reporter:
              janhoy Jan Høydahl
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development