3 # Licensed to the Apache Software Foundation (ASF) under one or more
4 # contributor license agreements. See the NOTICE file distributed with
5 # this work for additional information regarding copyright ownership.
6 # The ASF licenses this file to You under the Apache License, Version 2.0
7 # (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 # This script should be sourced into other zookeeper
19 # scripts to setup the env variables
21 # We use ZOOCFGDIR if defined,
22 # otherwise we use /etc/zookeeper
23 # or the conf directory that is
24 # a sibling of this script's directory
26 ZOOBINDIR=/usr/share/masterkey/lui/zookeeper/bin
27 ZOOKEEPER_PREFIX="${ZOOBINDIR}/.."
28 ZOOCFGDIR=/etc/masterkey/lui/zookeeper
29 ZOO_LOG_DIR=/var/log/masterkey/lui
30 ZOOPIDDIR=/var/lib/masterkey/lui
31 ZOOPIDFILE=${ZOOPIDDIR}/zookeeper_server.pid
33 if [ "x$ZOOCFGDIR" = "x" ]
35 if [ -e "${ZOOKEEPER_PREFIX}/conf" ]; then
36 ZOOCFGDIR="$ZOOBINDIR/../conf"
38 ZOOCFGDIR="$ZOOBINDIR/../etc/zookeeper"
42 if [ "x$ZOOCFG" = "x" ]
47 ZOOCFG="$ZOOCFGDIR/$ZOOCFG"
49 if [ -f "$ZOOCFGDIR/java.env" ]
51 . "$ZOOCFGDIR/java.env"
54 if [ "x${ZOO_LOG_DIR}" = "x" ]
59 if [ "x${ZOO_LOG4J_PROP}" = "x" ]
61 ZOO_LOG4J_PROP="INFO,CONSOLE"
64 if [ "$JAVA_HOME" != "" ]; then
65 JAVA="$JAVA_HOME/bin/java"
70 #add the zoocfg dir to classpath
71 CLASSPATH="$ZOOCFGDIR:$CLASSPATH"
73 for i in "$ZOOBINDIR"/../src/java/lib/*.jar
75 CLASSPATH="$i:$CLASSPATH"
78 #make it work in the binary package
79 if [ -e "${ZOOKEEPER_PREFIX}"/share/zookeeper/zookeeper-*.jar ]; then
80 for i in "$ZOOKEEPER_PREFIX"/share/zookeeper/*.jar
82 CLASSPATH="$i:$CLASSPATH"
85 #release tarball format
86 for i in "$ZOOBINDIR"/../zookeeper-*.jar
88 CLASSPATH="$i:$CLASSPATH"
90 for i in "$ZOOBINDIR"/../lib/*.jar
92 CLASSPATH="$i:$CLASSPATH"
96 #make it work for developers
97 for d in "$ZOOBINDIR"/../build/lib/*.jar
99 CLASSPATH="$d:$CLASSPATH"
102 #make it work for developers
103 CLASSPATH="$ZOOBINDIR/../build/classes:$CLASSPATH"
106 CYGWIN*) cygwin=true ;;
112 CLASSPATH=`cygpath -wp "$CLASSPATH"`
115 #echo "CLASSPATH=$CLASSPATH"