This is an automated email from the ASF dual-hosted git repository.

sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new 51c26dc  Only check ipv6 binding when /sbin/sysctl exists
51c26dc is described below

commit 51c26dcf3446ef0bf2bc7c753e5d188e29123ae8
Author: Sijie Guo <si...@apache.org>
AuthorDate: Sun Apr 15 15:07:38 2018 -0700

    Only check ipv6 binding when /sbin/sysctl exists
    
    Descriptions of the changes in this PR:
    
    *Problem*
    
    If bookkeeper is included in some slim docker images, sysctl might not 
exists at all.
    It would fail bookie to start.
    
    *Solution*
    
    Only check ipv6 binding when /sbin/sysctl exists
    
    Author: Sijie Guo <si...@apache.org>
    
    Reviewers: Enrico Olivelli <eolive...@gmail.com>, Matteo Merli 
<mme...@apache.org>
    
    This closes #1340 from sijie/disable_ipv6_binding
---
 bin/bookkeeper | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/bin/bookkeeper b/bin/bookkeeper
index 6b5bacd..3ceefe5 100755
--- a/bin/bookkeeper
+++ b/bin/bookkeeper
@@ -18,13 +18,15 @@
 # * limitations under the License.
 # */
 
-# check if net.ipv6.bindv6only is set to 1
-bindv6only=$(/sbin/sysctl -n net.ipv6.bindv6only 2> /dev/null)
-if [ -n "$bindv6only" ] && [ "$bindv6only" -eq "1" ]
-then
-  echo "Error: \"net.ipv6.bindv6only\" is set to 1 - Java networking could be 
broken"
-  echo "For more info (the following page also applies to bookkeeper): 
http://wiki.apache.org/hadoop/HadoopIPv6";
-  exit 1
+if [ -f /sbin/sysctl ]; then
+  # check if net.ipv6.bindv6only is set to 1
+  bindv6only=$(/sbin/sysctl -n net.ipv6.bindv6only 2> /dev/null)
+  if [ -n "$bindv6only" ] && [ "$bindv6only" -eq "1" ]
+  then
+    echo "Error: \"net.ipv6.bindv6only\" is set to 1 - Java networking could 
be broken"
+    echo "For more info (the following page also applies to bookkeeper): 
http://wiki.apache.org/hadoop/HadoopIPv6";
+    exit 1
+  fi
 fi
 
 # See the following page for extensive details on setting

-- 
To stop receiving notification emails like this one, please contact
si...@apache.org.

Reply via email to