Skip to content

Instantly share code, notes, and snippets.

@toddysm

toddysm/fix.sh

Forked from alexalouit/fix.sh
Created May 25, 2020
Embed
What would you like to do?
fix Logstash error "logstash load error: ffi/ffi -- java.lang.NullPointerException: null" on Raspbian
#!/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
apt-get update
apt-get install -f zip unzip
STARTDIR=$(pwd)
JARDIR="/usr/share/logstash/logstash-core/lib/jars"
JAR="jruby-complete-9.2.9.0.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
You can’t perform that action at this time.