Bug 217457 - net-mgmt/riemann: fix CLASSPATH support
Summary: net-mgmt/riemann: fix CLASSPATH support
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Kirill Ponomarev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-01 18:01 UTC by Jérôme Renard
Modified: 2017-03-13 18:26 UTC (History)
2 users (show)

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


Attachments
bug fix (777 bytes, patch)
2017-03-01 18:01 UTC, Jérôme Renard
no flags Details | Diff
v2 patch (2.21 KB, patch)
2017-03-01 23:30 UTC, Dave Cottlehuber
no flags Details | Diff
v3 patch incl bumping portrevision (2.70 KB, patch)
2017-03-08 21:05 UTC, Dave Cottlehuber
dch: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jérôme Renard 2017-03-01 18:01:40 UTC
Created attachment 180399 [details]
bug fix

Classpath settings ignored

The classpath setting is ignored when starting up riemann

The following code displays the Java CLASSPATH:

/usr/local/etc/riemann/riemann.config:

  (doseq [line (.getURLs (java.lang.ClassLoader/getSystemClassLoader))] (prn line))

When launching riemann as the service file currently does (the -X arguments are
removed for brevity) we get the following result:

/usr/local/openjdk8/bin/java -cp a/b:/usr/local/share/java/classes/riemann.jar -jar /usr/local/share/java/classes/riemann.jar /usr/local/etc/riemann/riemann.config                                                                                                                                                                                            

  [...]
  #object[java.net.URL 0xeed890d "file:/usr/local/share/java/classes/riemann.jar"]
  #object[java.net.URL 0x10f477e2 "file:/usr/local/etc/riemann/"]

As we can see, no CLASSPATH support

Riemann should be started like this: 

/usr/local/openjdk8/bin/java -cp a/b:/usr/local/share/java/classes/riemann.jar riemann.bin start /usr/local/etc/riemann/riemann.config

  [...]
  #object[java.net.URL 0x5b8572df "file:/usr/home/iznogoud/a/b"]
  #object[java.net.URL 0x7aaad0 "file:/usr/local/share/java/classes/riemann.jar"]
  #object[java.net.URL 0xeed890d "file:/usr/local/etc/riemann/"]

Now we have CLASSPATH support :)

A patch with a bug fix is attached

Now in /etc/rc.conf.d/riemmann we can get the following configuration:

  riemann_jarfile="/usr/local/share/java/classes/riemann.jar"
  riemann_java_classpath="${riemann_jarfile}:xxx.jar:yyy.jar"

Controlling the classpath may be of importance to some user especially the ones
who want to use riemann plugins like https://github.com/pyr/riemann-extra/

'hope that helps

:)
Comment 1 Dave Cottlehuber freebsd_committer freebsd_triage 2017-03-01 23:30:26 UTC
Created attachment 180424 [details]
v2 patch

I'm not able to check this patch right now, hopefully tomorrow. But its a great idea and nice work Jerome. Merci Bcp.
Comment 2 Dave Cottlehuber freebsd_committer freebsd_triage 2017-03-08 21:05:04 UTC
Created attachment 180646 [details]
v3 patch incl bumping portrevision

krion@ LGTM

this patch now includes the PORTREVISION which was missing from the previous one.

# QA

- portlint OK

WARN: Makefile: possible use of absolute pathname "/var/log/${PORTNAME}...".
WARN: Makefile: possible use of absolute pathname "/var/run/${PORTNAME}...".
WARN: Makefile: no ftp/http mirror in MASTER_SITES for users behind a proxy.
WARN: /usr/ports/net-mgmt/riemann/distinfo: [1]: TIMESTAMP is over 30 days old
0 fatal errors and 4 warnings found.

- poudriere

waiting for building everything still.
Comment 3 commit-hook freebsd_committer freebsd_triage 2017-03-13 18:26:42 UTC
A commit references this bug:

Author: krion
Date: Mon Mar 13 18:25:44 UTC 2017
New revision: 436104
URL: https://svnweb.freebsd.org/changeset/ports/436104

Log:
  Fix Java CLASSPATH settings to launch riemann

  PR:		217457
  Submitted by:	jeromer@fastmail.net
  Approved by:	maintainer, mat (mentor)
  Differential Revision: https://reviews.freebsd.org/D9977

Changes:
  head/net-mgmt/riemann/Makefile
  head/net-mgmt/riemann/files/riemann.in