Bug 233843

Summary: sysutils/logstash5: logstash-plugin binary is not executable
Product: Ports & Packages Reporter: Sven Ruediger <admin>
Component: Individual Port(s)Assignee: freebsd-elastic (Nobody) <elastic>
Status: Closed Overcome By Events    
Severity: Affects Many People CC: dvl, otis, w.schwarzenfeld
Priority: --- Keywords: easy, needs-patch, needs-qa
Version: LatestFlags: dvl: maintainer-feedback+
koobs: merge-quarterly?
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Makefile patch
none
Makefile patch (Logstash6 approach) none

Description Sven Ruediger 2018-12-07 07:37:40 UTC
Created attachment 199921 [details]
Makefile patch

Hi,

/usr/local/logstash/bin/logstash-plugin ist not executable after installation.
Might be fixed in during post-install, suggested patch attached.

Thanks
Sven
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2018-12-07 08:16:49 UTC
If a better alternate method within the context of the build system (such as a bug fix) is not possible/feasable, the workaround the manually modify the executables permissions should:

- Use the ${CHMOD} variable provided by the framework
- Use ${LOCALBASE} / PREFIX-safe variable for the path
- Happen at post-install: stage (in STAGEDIR}

However, the port already includes the following block in do-install:

  for x in ${LOGSTASH_BIN_FILES}
    @${CHMOD} ${BINMODE} ${STAGEDIR}${LOGSTASH_DIR}/bin/${x}

But LOGSTASH_BIN_FILES only contains 'logstash'

The sysutils/logstash6 port takes a more robust approach, but chmod'ing all binaries in the path:

  ${CHMOD} ${BINMODE} ${STAGEDIR}${LOGSTASH_DIR}/bin/*

I recommend taking the latter (logstash6) approach in this port.
Comment 2 Sven Ruediger 2018-12-07 09:05:05 UTC
Comment on attachment 199921 [details]
Makefile patch

--- Makefile.old        2018-12-07 08:34:05.078672000 +0100
+++ Makefile    2018-12-07 09:26:14.080053000 +0100
@@ -43,9 +43,7 @@
        ${MKDIR} ${STAGEDIR}${ETCDIR}
        @(cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${LOGSTASH_DIR})
        ${INSTALL_DATA} ${FILESDIR}/logstash.conf.sample ${STAGEDIR}${ETCDIR}
-.for x in ${LOGSTASH_BIN_FILES}
-       @${CHMOD} ${BINMODE} ${STAGEDIR}${LOGSTASH_DIR}/bin/${x}
-.endfor
+       ${CHMOD} ${BINMODE} ${STAGEDIR}${LOGSTASH_DIR}/bin/*
 .for x in ${LOGSTASH_JRUBY_BIN_FILES}
        @${CHMOD} ${BINMODE} ${STAGEDIR}${LOGSTASH_DIR}/${LOGSTASH_JRUBY_SUBDIR}/${x}
 .endfor
Comment 3 Sven Ruediger 2018-12-07 09:06:20 UTC
Thanks for the help. The Logstash5 approach (for loop) doesn't work.

[...]
-r-xr-xr-x  1 root  wheel  2511 Feb 16  2018 logstash
-rw-r--r--  1 root  wheel   448 Feb 16  2018 logstash-plugin
-rw-r--r--  1 root  wheel  5400 Feb 16  2018 logstash.lib.sh
[..]

The Logstash6 approach fixes that. New patch is attached.
Comment 4 Sven Ruediger 2018-12-07 09:07:28 UTC
Created attachment 199925 [details]
Makefile patch (Logstash6 approach)
Comment 5 Walter Schwarzenfeld freebsd_triage 2019-08-13 17:18:21 UTC
Maintainer feedback!
Comment 6 Dan Langille freebsd_committer freebsd_triage 2019-12-02 21:04:12 UTC
maintainer approved.  Might as well also delete LOGSTASH_BIN_FILES definition.
Comment 7 Juraj Lutter freebsd_committer freebsd_triage 2021-02-14 21:06:43 UTC
This port is no longer actively maintained and is scheduled for removal.