Skip to content

Commit

Permalink
Revert src/logback.xml
Browse files Browse the repository at this point in the history
Add logback.xml from deb package to rpm directory
Move opentsdb_restart.py to tools directory
Create symlinks during RPM installation

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
  • Loading branch information
manolama committed Apr 18, 2014
1 parent 2c0d526 commit acc4939
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 31 deletions.
26 changes: 15 additions & 11 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ plugin_test_jar := plugin_test.jar
builddata_SRC := src/BuildData.java
BUILT_SOURCES = $(builddata_SRC)
nodist_bin_SCRIPTS = tsdb
dist_noinst_SCRIPTS = src/create_table.sh src/mygnuplot.sh src/mygnuplot.bat \
src/opentsdb.conf src/opentsdb_restart.py
dist_noinst_DATA = pom.xml.in build-aux/rpm/opentsdb.conf build-aux/rpm/init.d/opentsdb
dist_noinst_SCRIPTS = src/create_table.sh src/upgrade_1to2.sh src/mygnuplot.sh \
src/mygnuplot.bat src/opentsdb.conf tools/opentsdb_restart.py src/logback.xml
dist_noinst_DATA = pom.xml.in build-aux/rpm/opentsdb.conf \
build-aux/rpm/logback.xml build-aux/rpm/init.d/opentsdb
tsdb_SRC := \
src/core/Aggregator.java \
src/core/Aggregators.java \
Expand Down Expand Up @@ -216,7 +217,7 @@ httpui_SRC := \

httpui_DEPS = src/tsd/QueryUi.gwt.xml

dist_pkgdata_DATA = src/logback.xml
#dist_pkgdata_DATA = src/logback.xml
dist_static_DATA = src/tsd/static/favicon.ico

EXTRA_DIST = tsdb.in $(tsdb_SRC) $(test_SRC) \
Expand All @@ -226,6 +227,7 @@ EXTRA_DIST = tsdb.in $(tsdb_SRC) $(test_SRC) \
tools/check_tsd \
tools/clean_cache.sh \
tools/tsddrain.py \
tools/opentsdb_restart.py \
opentsdb.spec \
bootstrap build.sh build-aux/gen_build_data.sh $(builddata_SRC)

Expand Down Expand Up @@ -265,8 +267,8 @@ printdeps:
# This is kind of a hack, but I couldn't find a better way to adjust the paths
# in the script before it gets installed...
install-exec-hook:
script=tsdb; pkgdatadir='$(pkgdatadir)'; abs_srcdir=''; abs_builddir=''; \
$(edit_tsdb_script)
script=tsdb; pkgdatadir='$(pkgdatadir)'; configdir='$(pkgdatadir)/etc/opentsdb'; \
abs_srcdir=''; abs_builddir=''; $(edit_tsdb_script)
cat tsdb.tmp >"$(DESTDIR)$(bindir)/tsdb"
rm -f tsdb.tmp

Expand Down Expand Up @@ -399,8 +401,11 @@ install-data-tools: $(tsdb_DEPS) $(jar)
destdatatoolsdir="$(DESTDIR)$(pkgdatadir)/tools" ; \
echo " $(mkdir_p) $$destdatatoolsdir"; \
$(mkdir_p) "$$destdatatoolsdir" || exit 1; \
echo " $(INSTALL_SCRIPT)" $(top_srcdir)/tools/* "$$destdatatoolsdir" ; \
$(INSTALL_SCRIPT) $(top_srcdir)/tools/* "$$destdatatoolsdir" || exit 1;
tools="$$tools $(top_srcdir)/tools/*" ; \
tools="$$tools $(top_srcdir)/src/create_table.sh" ; \
tools="$$tools $(top_srcdir)/src/upgrade_1to2.sh" ; \
echo " $(INSTALL_SCRIPT)" $$tools "$$destdatatoolsdir" ; \
$(INSTALL_SCRIPT) $$tools "$$destdatatoolsdir" || exit 1;

uninstall-data-tools:
@$(NORMAL_UNINSTALL)
Expand All @@ -413,10 +418,8 @@ install-data-bin: tsdb
destdatabindir="$(DESTDIR)$(pkgdatadir)/bin" ; \
echo " $(mkdir_p) $$destdatabindir"; \
$(mkdir_p) "$$destdatabindir" || exit 1; \
bins="$(top_srcdir)/src/create_table.sh" ; \
bins="$$bins $(top_srcdir)/src/mygnuplot.sh" ; \
bins="$$bins $(top_srcdir)/src/mygnuplot.bat" ; \
bins="$$bins $(top_srcdir)/src/opentsdb_restart.py" ; \
bins="$$bins $(DESTDIR)$(bindir)/tsdb" ; \
echo " $(INSTALL_SCRIPT)" $$bins "$$destdatabindir" ; \
$(INSTALL_SCRIPT) $$bins "$$destdatabindir" || exit 1;
Expand All @@ -440,7 +443,8 @@ install-data-etc:
$(mkdir_p) "$$destdataconfdir" || exit 1; \
echo " $(mkdir_p) $$destdatainitdir"; \
$(mkdir_p) "$$destdatainitdir" || exit 1; \
conf_files="$(top_srcdir)/build-aux/rpm/opentsdb.conf" ; \
conf_files="$$conf_files $(top_srcdir)/build-aux/rpm/opentsdb.conf" ; \
conf_files="$$conf_files $(top_srcdir)/build-aux/rpm/logback.xml" ; \
echo " $(INSTALL_SCRIPT)" $$conf_files "$$destdataconfdir" ; \
$(INSTALL_DATA) $$conf_files "$$destdataconfdir" || exit 1; \
init_file="$(top_srcdir)/build-aux/rpm/init.d/opentsdb" ; \
Expand Down
2 changes: 1 addition & 1 deletion build-aux/rpm/init.d/opentsdb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ start() {

# Set a default value for JVMARGS
: ${JVMXMX:=-Xmx6000m}
: ${JVMARGS:=-DLOG_FILE_PREFIX=${LOG_FILE} -enableassertions -enablesystemassertions $JVMXMX -XX:OnOutOfMemoryError=/usr/share/opentsdb/bin/opentsdb_restart.py}
: ${JVMARGS:=-DLOG_FILE_PREFIX=${LOG_FILE} -enableassertions -enablesystemassertions $JVMXMX -XX:OnOutOfMemoryError=/usr/share/opentsdb/tools/opentsdb_restart.py}
export JVMARGS

if [ "`id -u -n`" == root ] ; then
Expand Down
45 changes: 45 additions & 0 deletions build-aux/rpm/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!--<jmxConfigurator/>-->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>
%d{ISO8601} %-5level [%thread] %logger{0}: %msg%n
</pattern>
</encoder>
</appender>

<appender name="CYCLIC" class="ch.qos.logback.core.read.CyclicBufferAppender">
<MaxSize>1024</MaxSize>
</appender>

<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>/var/log/opentsdb/opentsdb.log</file>
<append>true</append>

<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>/var/log/opentsdb/opentsdb.log.%i</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>3</maxIndex>
</rollingPolicy>

<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>128MB</maxFileSize>
</triggeringPolicy>

<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} %-5level [%logger{0}.%M] - %msg%n</pattern>
</encoder>
</appender>

<logger name="org.apache.zookeeper" level="INFO"/>
<logger name="org.hbase.async" level="INFO"/>
<logger name="com.stumbleupon.async" level="INFO"/>
<root level="INFO">
<appender-ref ref="STDOUT"/>
<appender-ref ref="CYCLIC"/>
<appender-ref ref="FILE"/>
</root>
</configuration>
20 changes: 14 additions & 6 deletions opentsdb.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
mkdir -p %{buildroot}/var/cache/opentsdb
# TODO: Use alternatives to manage the init script and configuration.
# NOTE: Users should create symlinks to etc/init.d/opentsdb and
# etc/opentsdb/opentsdb.conf if they want to use the stock script and
# configuration.


%clean
rm -rf %{buildroot}
Expand All @@ -70,14 +66,26 @@ rm -rf %{buildroot}
%defattr(644,root,root,755)
%attr(0755,root,root) %{_bindir}/*
%attr(0755,root,root) %{_datarootdir}/opentsdb/bin/*.sh
%attr(0755,root,root) %{_datarootdir}/opentsdb/bin/*.py
%attr(0755,root,root) %{_datarootdir}/opentsdb/tools/*
%attr(0755,root,root) %{_datarootdir}/opentsdb/etc/init.d/opentsdb
%config %{_datarootdir}/opentsdb/etc/opentsdb/opentsdb.conf
%config %{_datarootdir}/opentsdb/etc/opentsdb/logback.xml
%doc
%{_datarootdir}/opentsdb
%{_bindir}/tsdb
%dir %{_localstatedir}/cache/opentsdb


%changelog

%post

ln -s %{_datarootdir}/opentsdb/etc/opentsdb /etc/opentsdb
ln -s %{_datarootdir}/opentsdb/etc/init.d/opentsdb /etc/init.d/opentsdb
exit 0

%postun

rm -rf /etc/opentsdb
rm -rf /etc/init.d/opentsdb

exit 0
14 changes: 1 addition & 13 deletions src/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,12 @@
<appender name="CYCLIC" class="ch.qos.logback.core.read.CyclicBufferAppender">
<MaxSize>1024</MaxSize>
</appender>
<!--Daily rolling file appender -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>${LOG_FILE_PREFIX}opentsdb.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>${LOG_FILE_PREFIX}opentsdb.%d{yyyy-MM-dd-HH}.log</FileNamePattern>
</rollingPolicy>
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>
%d{ISO8601} %-5level [%thread] %logger{0}: %msg%n
</pattern>
</layout>
</appender>

<logger name="org.apache.zookeeper" level="info"/>
<logger name="org.hbase.async" level="info"/>
<logger name="com.stumbleupon.async" level="info"/>
<root level="info">
<appender-ref ref="STDOUT"/>
<appender-ref ref="CYCLIC"/>
<appender-ref ref="FILE"/>
</root>
</configuration>
File renamed without changes.

0 comments on commit acc4939

Please sign in to comment.