Skip to content

Commit

Permalink
sys-cluster/zookeeper-bin: Backward release 3.4.13 (#829)
Browse files Browse the repository at this point in the history
  • Loading branch information
teerapatrk authored Jun 20, 2023
1 parent 0bfe401 commit b79276f
Show file tree
Hide file tree
Showing 6 changed files with 172 additions and 0 deletions.
1 change: 1 addition & 0 deletions sys-cluster/zookeeper-bin/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DIST zookeeper-3.4.13.tar.gz 37191810 BLAKE2B 994eecf982a19bbf3ae648c5d140746f5836f0f5d8921ed005ebccdedf0098591005b9038eb75fc660b48ae12b09b8db9dd68d3ac3b4ac9f847de214996e1efd SHA512 3481bd19945d80848f81d9dc2896a682ae8b62269b8164ffbae532e55aa4219961403e0208c8e72cf784605eae436d70ddae2b26e0deba0f1f84c74188c32c0a
58 changes: 58 additions & 0 deletions sys-cluster/zookeeper-bin/files/log4j.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Define some default values that can be overridden by system properties
zookeeper.root.logger=INFO, CONSOLE
zookeeper.console.threshold=INFO
zookeeper.log.dir=/var/log/zookeeper/
zookeeper.log.file=zookeeper.log
zookeeper.log.threshold=DEBUG
zookeeper.tracelog.dir=/var/log/zookeeper/
zookeeper.tracelog.file=zookeeper_trace.log

#
# ZooKeeper Logging Configuration
#

# Format is "<default threshold> (, <appender>)+

# DEFAULT: console appender only
#log4j.rootLogger=${zookeeper.root.logger}

# Example with rolling log file
log4j.rootLogger=CONSOLE, ROLLINGFILE

# Example with rolling log file and tracing
#log4j.rootLogger=TRACE, CONSOLE, ROLLINGFILE, TRACEFILE

#
# Log INFO level and above messages to the console
#
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=${zookeeper.console.threshold}
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n

#
# Add ROLLINGFILE to rootLogger to get log file output
# Log DEBUG level and above messages to a log file
log4j.appender.ROLLINGFILE=org.apache.log4j.RollingFileAppender
log4j.appender.ROLLINGFILE.Threshold=${zookeeper.log.threshold}
log4j.appender.ROLLINGFILE.File=${zookeeper.log.dir}/${zookeeper.log.file}

# Max log file size of 256MB
log4j.appender.ROLLINGFILE.MaxFileSize=256MB
# uncomment the next line to limit number of backup files
log4j.appender.ROLLINGFILE.MaxBackupIndex=10

log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n


#
# Add TRACEFILE to rootLogger to get log file output
# Log DEBUG level and above messages to a log file
log4j.appender.TRACEFILE=org.apache.log4j.FileAppender
log4j.appender.TRACEFILE.Threshold=TRACE
log4j.appender.TRACEFILE.File=${zookeeper.tracelog.dir}/${zookeeper.tracelog.file}

log4j.appender.TRACEFILE.layout=org.apache.log4j.PatternLayout
### Notice we are including log4j's NDC here (%x)
log4j.appender.TRACEFILE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L][%x] - %m%n
18 changes: 18 additions & 0 deletions sys-cluster/zookeeper-bin/files/zookeeper.confd
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# JVM options
JVM_OPTS=""

# zookeeper files
MAIN="org.apache.zookeeper.server.quorum.QuorumPeerMain"
CONFIG="/opt/zookeeper-bin/conf/zoo.cfg"

# build the classpath
INSTALL_DIR=/opt/zookeeper-bin
CLASSPATH="${INSTALL_DIR}/conf:${CLASSPATH}"

for i in ${INSTALL_DIR}/zookeeper-*.jar; do
CLASSPATH="${i}:${CLASSPATH}"
done

for i in ${INSTALL_DIR}/lib/*.jar; do
CLASSPATH="${i}:${CLASSPATH}"
done
14 changes: 14 additions & 0 deletions sys-cluster/zookeeper-bin/files/zookeeper.initd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/sbin/openrc-run
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

name="zookeeper"
command="/usr/bin/java"
command_args="${JVM_OPTS} -cp ${CLASSPATH} ${MAIN} ${CONFIG}"
command_background="true"
start_stop_daemon_args="--user zookeeper --group zookeeper"
pidfile="/var/run/zookeeper.pid"

depend() {
need net
}
12 changes: 12 additions & 0 deletions sys-cluster/zookeeper-bin/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>[email protected]</email>
<name>Patrick Lauer</name>
</maintainer>
<maintainer type="project">
<email>[email protected]</email>
<name>Gentoo Cluster Project</name>
</maintainer>
</pkgmetadata>
69 changes: 69 additions & 0 deletions sys-cluster/zookeeper-bin/zookeeper-bin-3.4.13-r1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit java-utils-2

MY_PN="zookeeper"
MY_P="${MY_PN}-${PV}"

DESCRIPTION="A high-performance coordination service for distributed applications"
HOMEPAGE="https://zookeeper.apache.org/"
SRC_URI="https://archive.apache.org/dist/${MY_PN}/${MY_P}/${MY_P}.tar.gz"
S="${WORKDIR}/${MY_P}"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"
RESTRICT="mirror binchecks"

BDEPEND="
acct-group/zookeeper
acct-user/zookeeper
"
RDEPEND="
${BDEPEND}
>=virtual/jre-1.7
"

INSTALL_DIR=/opt/"${PN}"
export CONFIG_PROTECT="${CONFIG_PROTECT} ${INSTALL_DIR}/conf"

src_prepare() {
default
rm "${S}"/docs/images/instruction_arrow.png || die
rm "${S}"/docs/skin/images/instruction_arrow.png || die
}

src_install() {
local DATA_DIR=/var/lib/"${MY_P}"

# cleanup sources
rm bin/*.cmd || die

keepdir "${DATA_DIR}"
sed "s:^dataDir=.*:dataDir=${DATA_DIR}:" conf/zoo_sample.cfg > conf/zoo.cfg || die
cp "${FILESDIR}"/log4j.properties conf/ || die

dodir "${INSTALL_DIR}"
cp -a "${S}"/* "${ED}${INSTALL_DIR}" || die

# data dir perms
fowners zookeeper:zookeeper "${DATA_DIR}"

# log dir
keepdir /var/log/zookeeper
fowners zookeeper:zookeeper /var/log/zookeeper

# init script
newinitd "${FILESDIR}"/zookeeper.initd zookeeper
newconfd "${FILESDIR}"/zookeeper.confd zookeeper

# env file
cat > 99"${PN}" <<-EOF
PATH="${INSTALL_DIR}"/bin
CONFIG_PROTECT="${INSTALL_DIR}"/conf
EOF
doenvd 99"${PN}"
}

0 comments on commit b79276f

Please sign in to comment.