After having installed opentsdb I saw that /var/log/opentsdb/tsdb.log is logging with DEBUG verbosity while in /usr/local/etc/opentsdb/logging.xml I specified an INFO level. Looking in /usr/local/bin/tsdb I saw that confidir is set to /etc/opentsdb. Looking further I found an error in Makefile.in with a typo between sysconfdir (the option specified in configure) and sysconfigdir (the var used to specify a config directory). I'd like to report this to the mainstream software repository but I didn't find any Makefile.in in their github repo (and I'm not in autotools stuff). The patch is trivial: # diff -uh Makefile.orig Makefile --- Makefile.orig 2016-01-04 04:16:51.446052000 -0500 +++ Makefile 2016-01-04 04:16:47.303694000 -0500 @@ -46,6 +46,7 @@ post-patch: ${REINPLACE_CMD} -i "" -e "s|python|${PYTHON_CMD}|" ${WRKSRC}/build-aux/gen_build_data.sh #${REINPLACE_CMD} -i "" -e "s|%%PREFIX%%|${PREFIX}|" ${WRKSRC}/Makefile.in + ${REINPLACE_CMD} -i "" -e "s|sysconfigdir|sysconfdir|" ${WRKSRC}/Makefile.in ${REINPLACE_CMD} -i "" -e "s|%%PREFIX%%|${PREFIX}|" ${WRKSRC}/src/utils/Config.java ${REINPLACE_CMD} -i "" -e "s|tsd.http.staticroot =|tsd.http.staticroot = ${DATADIR}/static|; s|tsd.http.cachedir =|tsd.http.cachedir = /tmp/opentsdb|; s|tsd.network.port =|tsd.network.port = 4242|;" ${WRKSRC}/src/opentsdb.conf #
Thanks for your submission David :) Could you include your patch as an attachment please? Also, regarding the upstream sources, the Makefile.in is generated (by automake) from Makefile.am [1] files :) You should find that you need there [1] https://github.com/OpenTSDB/opentsdb/blob/master/Makefile.am While I'm here, Correct category/portname and CC maintainer
Created attachment 165042 [details] Patch to database/opentsdb to fix sysconfig/sysconf
I am seeing I specified 'logging.xml' as the file opentsdb uses for logging configuration options; the right filename is 'logback.xml': the patch is still valid.
Thank you Davide. If you create an upstream Issue/PR, please link it here in "See Also"
Thanks, I'll do in 8h (now busy doing other things).
LGTM, but make sure to submit a patch to upstream. Chris Larsen is usually very responsive, and this patch would probably apply to both 2.1.x as well as the current release candidate for 2.2.x.
Created attachment 165058 [details] Updated my patch using prefix instead of sysconfdir
Created attachment 165059 [details] Updated my patch using prefix instead of sysconfdir
Comment on attachment 165058 [details] Updated my patch using prefix instead of sysconfdir >--- Makefile.orig 2016-01-04 04:16:51.446052000 -0500 >+++ Makefile 2016-01-04 09:55:55.342634000 -0500 >@@ -46,6 +46,7 @@ > post-patch: > ${REINPLACE_CMD} -i "" -e "s|python|${PYTHON_CMD}|" ${WRKSRC}/build-aux/gen_build_data.sh > #${REINPLACE_CMD} -i "" -e "s|%%PREFIX%%|${PREFIX}|" ${WRKSRC}/Makefile.in >+ ${REINPLACE_CMD} -i "" -e "s|sysconfigdir|prefix|" ${WRKSRC}/Makefile.in > ${REINPLACE_CMD} -i "" -e "s|%%PREFIX%%|${PREFIX}|" ${WRKSRC}/src/utils/Config.java > ${REINPLACE_CMD} -i "" -e "s|tsd.http.staticroot =|tsd.http.staticroot = ${DATADIR}/static|; s|tsd.http.cachedir =|tsd.http.cachedir = /tmp/opentsdb|; s|tsd.network.port =|tsd.network.port = 4242|;" ${WRKSRC}/src/opentsdb.conf >
I had to change sysconfdir with prefix because sysconfdir is already including a etc/. I don't know if this can be solved via upstream because changing sysconfdir (as I proposed at first) with prefix could break something on other linux systems (I guess).
Good catch. Actually, files/patch-Makefile.in should probably include something like: - script=tsdb; pkgdatadir='$(pkgdatadir)'; configdir='$(sysconfigdir)/etc/opentsdb'; \ - script=tsdb; pkgdatadir='$(pkgdatadir)'; configdir='$(sysconfdir)/opentsdb'; \ Given that sysconfdir should always resolve to either /etc/, /usr/local/etc or something along those lines: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
Sounds not only good, but also better :)
Indeed, I'm currently running the patch through poudriere, let's see what happens..
Created attachment 165084 [details] replace sysconfigdir with configdir in files/patch-Makefile.in Patch attached fixes the typo introduced upstream in an earlier patch, replacing sysconfigdir with sysconfdir, and now sets configdir='/usr/local/etc/opentsdb' within /usr/local/bin/tsdb, so that the directory containing logback.xml is in CLASSPATH and that the file can actually be read by `tsdb`.
A commit references this bug: Author: miwi Date: Wed Jan 6 08:50:24 UTC 2016 New revision: 405340 URL: https://svnweb.freebsd.org/changeset/ports/405340 Log: - Fix wrong path searching for logback.xml - While here remove unused sed line - Bump PORTREVISION PR: 205868 Submitted by: Davide D'Amico (based on) Approved by: Johannes Jost Meixner (maintainer) Changes: head/databases/opentsdb/Makefile head/databases/opentsdb/files/patch-Makefile.in
Needs to be merged to quarterly, or set flag to - with comment
A commit references this bug: Author: miwi Date: Wed Jan 6 15:55:41 UTC 2016 New revision: 405363 URL: https://svnweb.freebsd.org/changeset/ports/405363 Log: MFH: r405340 - Fix wrong path searching for logback.xml - While here remove unused sed line - Bump PORTREVISION PR: 205868 Submitted by: Davide D'Amico (based on) Approved by: Johannes Jost Meixner (maintainer) Approved by: portmgr blanket Changes: _U branches/2016Q1/ branches/2016Q1/databases/opentsdb/Makefile branches/2016Q1/databases/opentsdb/files/patch-Makefile.in