Bug 233843 - sysutils/logstash5: logstash-plugin binary is not executable
Summary: sysutils/logstash5: logstash-plugin binary is not executable
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-elastic mailing list
URL:
Keywords: easy, needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2018-12-07 07:37 UTC by Sven R
Modified: 2018-12-07 09:07 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (elastic)
koobs: merge-quarterly?


Attachments
Makefile patch (430 bytes, text/plain)
2018-12-07 07:37 UTC, Sven R
no flags Details
Makefile patch (Logstash6 approach) (633 bytes, text/plain)
2018-12-07 09:07 UTC, Sven R
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sven R 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 R 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 R 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 R 2018-12-07 09:07:28 UTC
Created attachment 199925 [details]
Makefile patch (Logstash6 approach)