Mark Elrod created ZOOKEEPER-2406:
-------------------------------------

             Summary: /etc/zookeeper isn't used for ZOOCFGDIR
                 Key: ZOOKEEPER-2406
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2406
             Project: ZooKeeper
          Issue Type: Bug
    Affects Versions: 3.5.1
            Reporter: Mark Elrod
            Priority: Minor


The comment in zkEnv.sh indicates that /etc/zookeeper should be an option for 
the ZOOCFGDIR but the code beneath it does not look to see if it exists:

{noformat}
# We use ZOOCFGDIR if defined,                                                  
                                                                                
                              
# otherwise we use /etc/zookeeper                                               
                                                                                
                              
# or the conf directory that is                                                 
                                                                                
                              
# a sibling of this script's directory   


ZOOBINDIR="${ZOOBINDIR:-/usr/bin}"
ZOOKEEPER_PREFIX="${ZOOBINDIR}/.."

if [ "x$ZOOCFGDIR" = "x" ]
then
  if [ -e "${ZOOKEEPER_PREFIX}/conf" ]; then
    ZOOCFGDIR="$ZOOBINDIR/../conf"
  else
    ZOOCFGDIR="$ZOOBINDIR/../etc/zookeeper"
  fi
fi                                                                              
                                                                       
{noformat}

Should this be something like:

{noformat}
if [ "x$ZOOCFGDIR" = "x" ]
then
  if [ -e "/etc/zookeeper" ]; then
    ZOOCFGDIR="/etc/zookeeper"
  elif [ -e "${ZOOKEEPER_PREFIX}/conf" ]; then
    ZOOCFGDIR="$ZOOBINDIR/../conf"
  else
    ZOOCFGDIR="$ZOOBINDIR/../etc/zookeeper"
  fi
fi            
{noformat}

I am not sure if ZOOBINDIR/../etc/zookeeper is supposed to be an option or a 
typo but in the default setup ZOOBINDIR/../conf exists so even if it were 
changed to /etc/zookeeper it would never try to use it.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to