This is an automated email from the ASF dual-hosted git repository.
janhoy pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new 00955890f19 SOLR-17039: Entropy calculation fails in Docker due to
missing 'bc' cmd (#2023)
00955890f19 is described below
commit 00955890f19b26ce799b08d4351bcfbddcd58846
Author: Jan Høydahl <[email protected]>
AuthorDate: Wed Oct 18 22:06:46 2023 +0200
SOLR-17039: Entropy calculation fails in Docker due to missing 'bc' cmd
(#2023)
(cherry picked from commit 5a9f914a6a6dffd1bbceb8a5cd9a5cc8ad2bd60e)
---
solr/CHANGES.txt | 2 ++
solr/bin/solr | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index f915224f017..ac0a9254310 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -23,6 +23,8 @@ Bug Fixes
---------------------
* SOLR-6853: Allow '/' characters in the text managed by Managed Resources
API. (Nikita Rusetskii via Eric Pugh)
+* SOLR-17039: Entropy calculation in bin/solr script fails in Docker due to
missing 'bc' cmd (janhoy)
+
Dependency Upgrades
---------------------
* SOLR-17012: Update Apache Hadoop to 3.3.6 and Apache Curator to 5.5.0 (Kevin
Risden)
diff --git a/solr/bin/solr b/solr/bin/solr
index 116365ac1de..f3356343e9f 100644
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -2402,10 +2402,10 @@ function start_solr() {
# Check if entropy is available and pool size is non-zero
if [[ $entropy_avail -gt 0 && $pool_size -ne 0 ]]; then
# Compute the ratio of entropy available to pool size
- ratio=$(awk -v ea="$entropy_avail" -v ps="$pool_size" 'BEGIN {print
(ea/ps)*100}')
+ ratio=$(awk -v ea="$entropy_avail" -v ps="$pool_size" 'BEGIN {print
int((ea/ps)*100)}')
# Check if the ratio is less than 25%
- if (( $(echo "$ratio < 25" | bc -l) )); then
+ if (( ratio < 25 )); 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'."
fi