Bug 195860 - textproc/apache-solr specifies JAVA_VERSION=1.7+ but solr rc.d script runs only with OpenJDK 7 (includes suggested fix)
Summary: textproc/apache-solr specifies JAVA_VERSION=1.7+ but solr rc.d script runs on...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-10 21:47 UTC by Paul Mather
Modified: 2015-02-15 21:38 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (gaod)


Attachments
Diff to /usr/local/etc/rc.d/solr to allow Solr to run using current default Java (577 bytes, patch)
2014-12-10 21:47 UTC, Paul Mather
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Mather 2014-12-10 21:47:24 UTC
Created attachment 150438 [details]
Diff to /usr/local/etc/rc.d/solr to allow Solr to run using current default Java

The Makefile for textproc/apache-solr specifies that it works with Java 1.7+.  This version of Solr will run with Java 1.7 or 1.8 but the startup rc.d script "solr" hardcodes procname as /usr/local/openjdk7/bin/java.  This means the script won't work properly if, say, OpenJDK 8 is installed.

A possible fix for this is to set procname according to the Java VM actually run via /usr/local/bin/java, i.e.:

procname=`env JAVAVM_DRYRUN=true /usr/local/bin/java | grep JAVAVM_PROG | cut -f 2 -d =`

See attached diff.

Cheers,

Paul.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-12-10 21:47:24 UTC
Maintainer CC'd
Comment 2 John Marino freebsd_committer freebsd_triage 2015-02-06 16:55:03 UTC
hmmm?

Why not just change the line
JAVA_VERSION= 1.7+ 
to 
JAVA_VERSION= 1.7
?

It appears that the maintainer did not respond to this PR either, and he timed out on an earlier PR.  That's 3 consecutive PRs that are timed out, so I'm resetting the port to have no maintainer, right now.
Comment 3 Paul Mather 2015-02-06 17:29:18 UTC
(In reply to John Marino from comment #2)

The version of Solr in the port will work with Java 1.7 and Java 1.8.  Making the change you suggest will force an installation of Java 1.7 even in the case where the user already has only Java 1.8 installed (which would nevertheless be adequate to run Solr).

My suggested change looks at what the default "java" actually is and uses that for the procname.  It would be nice to have someone familiar with Java ports comment on the standard way to do this, as I'm not too familiar with the runtime Java selection mechanism.  For example, the approach here might be problematic if a system has Java 1.6, 1.7, and 1.8 installed but Java 1.6 set to being the default.

Your suggested change is the safest, although it does violate the spirit of the original "JAVA_VERSION= 1.7+" option and forces the installation of Java 1.7.
Comment 4 Greg Lewis freebsd_committer freebsd_triage 2015-02-15 21:30:24 UTC
I prefer the submitted version since it means one less port that needs updating when we switch the default to openjdk8.
Comment 5 commit-hook freebsd_committer freebsd_triage 2015-02-15 21:36:43 UTC
A commit references this bug:

Author: glewis
Date: Sun Feb 15 21:36:30 UTC 2015
New revision: 379050
URL: https://svnweb.freebsd.org/changeset/ports/379050

Log:
  . Allow Apache Solr to be run with either openjdk7 or openjdk8.

  PR:		195860
  Submitted by:	paul@gromit.dlib.vt.edu

Changes:
  head/textproc/apache-solr/files/solr.in
Comment 6 Greg Lewis freebsd_committer freebsd_triage 2015-02-15 21:38:01 UTC
Suggested fix committed with a minor tweak to prevent openjdk6 from ever being used.