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
34 JVMFLAGS="-Xmx512m -Xms256m"
36 if [ "x$ZOOCFGDIR" = "x" ]
38 if [ -e "${ZOOKEEPER_PREFIX}/conf" ]; then
39 ZOOCFGDIR="$ZOOBINDIR/../conf"
41 ZOOCFGDIR="$ZOOBINDIR/../etc/zookeeper"
45 if [ "x$ZOOCFG" = "x" ]
50 ZOOCFG="$ZOOCFGDIR/$ZOOCFG"
52 if [ -f "$ZOOCFGDIR/java.env" ]
54 . "$ZOOCFGDIR/java.env"
57 if [ "x${ZOO_LOG_DIR}" = "x" ]
62 if [ "x${ZOO_LOG4J_PROP}" = "x" ]
64 ZOO_LOG4J_PROP="INFO,CONSOLE"
67 if [ "$JAVA_HOME" != "" ]; then
68 JAVA="$JAVA_HOME/bin/java"
73 #add the zoocfg dir to classpath
74 CLASSPATH="$ZOOCFGDIR:$CLASSPATH"
76 for i in "$ZOOBINDIR"/../src/java/lib/*.jar
78 CLASSPATH="$i:$CLASSPATH"
81 #make it work in the binary package
82 if [ -e "${ZOOKEEPER_PREFIX}"/share/zookeeper/zookeeper-*.jar ]; then
83 for i in "$ZOOKEEPER_PREFIX"/share/zookeeper/*.jar
85 CLASSPATH="$i:$CLASSPATH"
88 #release tarball format
89 for i in "$ZOOBINDIR"/../zookeeper-*.jar
91 CLASSPATH="$i:$CLASSPATH"
93 for i in "$ZOOBINDIR"/../lib/*.jar
95 CLASSPATH="$i:$CLASSPATH"
99 #make it work for developers
100 for d in "$ZOOBINDIR"/../build/lib/*.jar
102 CLASSPATH="$d:$CLASSPATH"
105 #make it work for developers
106 CLASSPATH="$ZOOBINDIR/../build/classes:$CLASSPATH"
109 CYGWIN*) cygwin=true ;;
115 CLASSPATH=`cygpath -wp "$CLASSPATH"`
118 #echo "CLASSPATH=$CLASSPATH"