-
-
Save gwsales/5a27e6282063f902014d851247c5f448 to your computer and use it in GitHub Desktop.
fix Logstash error "logstash load error: ffi/ffi -- java.lang.NullPointerException: null" on Raspbian
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# based on https://github.com/mew2057/CAST/blob/6c7f7d514b7af3c512635ec145aa829c535467dc/csm_big_data/config-scripts/logstashFixupScript.sh | |
# see: https://github.com/elastic/logstash/issues/10755 | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi | |
apt-get update | |
apt-get install -f zip unzip | |
#VERSION="9.2.11.1" | |
VERSION=$(find /usr/share/logstash/logstash-core/lib/jars/ -name "jruby-complete*.jar" | sed 's/^.*jruby-complete-//' | sed 's/.jar$//') | |
STARTDIR=$(pwd) | |
JARDIR="/usr/share/logstash/logstash-core/lib/jars" | |
JAR="jruby-complete-${VERSION}.jar" | |
#JAR=$(basename $(find /usr/share/logstash/logstash-core/lib/jars/ -name "jruby-complete*.jar")) | |
JRUBYDIR="${JAR}-dir" | |
PLATDIR="META-INF/jruby.home/lib/ruby/stdlib/ffi/platform/arm-linux" | |
cd ${JARDIR} | |
unzip -d ${JRUBYDIR} ${JAR} | |
cd "${JRUBYDIR}/${PLATDIR}" | |
cp -n types.conf platform.conf | |
cd "${JARDIR}/${JRUBYDIR}" | |
zip -r $JAR * | |
mv -f $JAR .. | |
cd ${JARDIR} | |
rm -rf ${JRUBYDIR} | |
chown logstash:logstash $JAR | |
sync | |
sync | |
cd ${STARTDIR} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment