Skip to content

Commit

Permalink
setup building of a correct sample config, refs circonus-labs#50
Browse files Browse the repository at this point in the history
  • Loading branch information
postwait committed Aug 4, 2008
1 parent 7180374 commit e1b3535
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 13 deletions.
6 changes: 3 additions & 3 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,9 @@ while test "x$temppath" != "x$fullpath" ; do
fullpath=`eval echo ${fullpath}`
done
fullpath=`echo $fullpath | sed "s~NONE~$ac_default_prefix~"`
AC_MSG_RESULT([$fullpath])
AC_DEFINE_UNQUOTED(MODULES_DIR, "${fullpath}")
MODULES_DIR=${fullpath}
AC_MSG_RESULT([$fullpath/noit])
AC_DEFINE_UNQUOTED(MODULES_DIR, "${fullpath}/noit")
MODULES_DIR=${fullpath}/noit
AC_SUBST(MODULES_DIR)

AC_MSG_CHECKING([Resolving sysconfdir path...])
Expand Down
19 changes: 18 additions & 1 deletion src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ docdir=${prefix}/@docdir@
sysconfdir=@sysconfdir@
srcdir=@srcdir@
top_srcdir=@top_srcdir@
MODULES_DIR=@MODULES_DIR@

WHOLE_ARCHIVE=@WHOLE_ARCHIVE@
NOWHOLE_ARCHIVE=@NOWHOLE_ARCHIVE@
Expand All @@ -40,7 +41,7 @@ STRATCON_OBJS=stratcond.o noit_listener.o \
noit_conf.o noit_tokenizer.o \
stratcon_jlog_streamer.o stratcon_datastore.o

all: noitd stratcond
all: noitd stratcond noit.conf test-noit.conf

make-subdirs: serf/.libs/libserf-0.o jlog/libjlog.a
for dir in $(SUBS) ; do \
Expand Down Expand Up @@ -99,6 +100,22 @@ noit_tokenizer.c: noit_tokenizer.re
@re2c -o $@ noit_tokenizer.re
@echo "- re2c $<"

test-noit.conf: noit.conf.in
sed -e "s^%sysconfdir%^.^g;" \
-e "s^%modulesdir%^./modules^g;" \
-e "s^%modulesluadir%^./modules-lua^g;" \
-e "s^%PKIPREFIX%^../test/test-^g;" < \
noit.conf.in > \
test-noit.conf

noit.conf: noit.conf.in
sed -e "s^%sysconfdir%^$(sysconfdir)^g;" \
-e "s^%modulesdir%^$(MODULES_DIR)^g;" \
-e "s^%modulesluadir%^$(MODULES_DIR)^g;" \
-e "s^%PKIPREFIX%^$${PKIPREFIX}^g;" < \
noit.conf.in > \
noit.conf

clean-subdirs:
for dir in $(SUBS) ; do \
(cd $$dir && make clean) ; \
Expand Down
18 changes: 9 additions & 9 deletions src/noit.conf → src/noit.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
<error>
<outlet name="error"/>
<log name="error/eventer"/>
<log name="error/ping_icmp" disabled="true"/>
<log name="error/serf" disabled="false"/>
<log name="error/snmp" disabled="true"/>
<log name="error/ping_icmp"/>
<log name="error/serf"/>
<log name="error/snmp"/>
</error>
<debug>
<log name="debug/eventer" disabled="true"/>
<log name="debug/ping_icmp" disabled="true"/>
<log name="debug/serf" disabled="false"><outlet name="error" /></log>
<log name="debug/serf" disabled="false"/>
<log name="debug/snmp" disabled="true"/>
</debug>
</components>
Expand All @@ -39,9 +39,9 @@
<log name="config"/>
</feeds>
</logs>
<modules directory="./modules">
<modules directory="%modulesdir%">
<loader image="lua" name="lua">
<config><directory>./modules-lua/?.lua</directory></config>
<config><directory>%modulesluadir%/?.lua</directory></config>
</loader>
<module image="ping_icmp" name="ping_icmp"/>
<http image="http">
Expand All @@ -56,9 +56,9 @@
<listeners>
<sslconfig>
<optional_no_ca>false</optional_no_ca>
<certificate_file>../test/test-noit.crt</certificate_file>
<key_file>../test/test-noit.key</key_file>
<ca_chain>../test/test-ca.crt</ca_chain>
<certificate_file>%sysconfdir%/%PKIPREFIX%noit.crt</certificate_file>
<key_file>%sysconfdir%/%PKIPREFIX%noit.key</key_file>
<ca_chain>%sysconfdir%/%PKIPREFIX%ca.crt</ca_chain>
</sslconfig>
<consoles type="noit_console">
<listener address="/tmp/noit">
Expand Down

0 comments on commit e1b3535

Please sign in to comment.