From 2ba54a36babd4cb6f2fb97e0f550d4980dbbced5 Mon Sep 17 00:00:00 2001 From: Ishan Chattopadhyaya Date: Mon, 27 Mar 2017 23:56:23 +0530 Subject: [PATCH] SOLR-10352: bin/solr script now prints warning when available system entropy is lower than 300 --- solr/CHANGES.txt | 3 +++ solr/bin/solr | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index e102b27e3e4..2cebb9fdea8 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -145,6 +145,9 @@ Other Changes * SOLR-10304: Refactor Document handling out of SolrIndexSearcher into a new class "SolrDocumentFetcher". Deprecated SolrPluginUtils.docListToSolrDocumentList(). (David Smiley) +* SOLR-10352: bin/solr script now prints warning when available system entropy is lower than 300 (Esther Quansah via + Ishan Chattopadhyaya) + ================== 6.5.0 ================== Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release. diff --git a/solr/bin/solr b/solr/bin/solr index 9563bb2df93..58fdcba6da4 100755 --- a/solr/bin/solr +++ b/solr/bin/solr @@ -1760,6 +1760,12 @@ function launch_solr() { -jar start.jar "${SOLR_JETTY_CONFIG[@]}" \ 1>"$SOLR_LOGS_DIR/solr-$SOLR_PORT-console.log" 2>&1 & echo $! > "$SOLR_PID_DIR/solr-$SOLR_PORT.pid" + # check if /proc/sys/kernel/random/entropy_avail exists then check output of cat /proc/sys/kernel/random/entropy_avail to see if less than 300 + if [[ -f /proc/sys/kernel/random/entropy_avail ]] && (( `cat /proc/sys/kernel/random/entropy_avail` < 30000)); then + echo "Warning: Available entropy is low. As a result, use of the UUIDField, SSL, or any other features that require" + echo "RNG might not work properly. To check for the amount of available entropy, use 'cat /proc/sys/kernel/random/entropy_avail'." + echo "" + fi # no lsof on cygwin though if hash lsof 2>/dev/null ; then # hash returns true if lsof is on the path echo -n "Waiting up to $SOLR_STOP_WAIT seconds to see Solr running on port $SOLR_PORT"