author | octo <octo> | |
Sat, 17 Dec 2005 09:23:52 +0000 (09:23 +0000) | ||
committer | octo <octo> | |
Sat, 17 Dec 2005 09:23:52 +0000 (09:23 +0000) |
1 | 2 | |||
---|---|---|---|---|
Makefile.am | patch | | diff1 | | diff2 | | blob | history |
configure.in | patch | | diff1 | | diff2 | | blob | history |
src/Makefile.am | patch | | diff1 | | diff2 | | blob | history |
src/collectd.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc Makefile.am
index a465d3cafc152e0b885386b149ce34f820c0ff86,d173ee70b0bd9698087dc2cfd3cd460dceed1343..30beb6397998679dfb342bf03f770e06522b97f4
--- 1/Makefile.am
--- 2/Makefile.am
+++ b/Makefile.am
find $(distdir) -type d -name '.svn' | xargs rm -rf
install-exec-hook:
++ $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
$(mkinstalldirs) $(DESTDIR)$(localstatedir)/run
$(mkinstalldirs) $(DESTDIR)$(localstatedir)/lib/$(PACKAGE_NAME)
- $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
diff --cc configure.in
index b68e94b33fa1b39bb86149061715f26e5a75f4c6,293fc6ad09ecf582afe246f4b629f3cd56c47d0c..e5cf5cb55a550b4a95ec040483478bd0b5d2beb0
--- 1/configure.in
--- 2/configure.in
+++ b/configure.in
fi
AM_CONDITIONAL(BUILD_MODULE_TRAFFIC, test "x$enable_traffic" = "xyes")
-AC_ARG_ENABLE(users, AC_HELP_STRING([--disable-users], [Disable user count statistics]),, [enable_users="yes"])
-if test "x$enable_users" != "xno"
-then
- if test "x$have_getutent" = "xyes"
- then
- enable_users="yes"
- else
- enable_users="no"
- fi
-fi
-if test "x$enable_users" = "xno"
-then
- AC_DEFINE(COLLECT_USERS, 0, [Wether or not to collect user count statistics])
-fi
-AM_CONDITIONAL(BUILD_MODULE_USERS, test "x$enable_users" = "xyes")
+AC_COLLECTD([users], [disable], [module], [user count statistics])
- AC_OUTPUT(Makefile src/libping/Makefile src/Makefile)
+ AC_OUTPUT(Makefile src/libconfig/Makefile src/libping/Makefile src/Makefile)
cat <<EOF;
diff --cc src/Makefile.am
index 6b85c0358689e2acf4765896a949bd620477602b,4f21f1c178dfbc9dca8b204d51de26614fbd914e..11e34a9fe1af9a39799415f11843c06739d3c1bb
--- 1/src/Makefile.am
--- 2/src/Makefile.am
+++ b/src/Makefile.am
+ SUBDIRS = libconfig
if BUILD_MODULE_PING
- SUBDIRS = libping .
+ SUBDIRS += libping
endif
-#SUBDIRS += .
sbin_PROGRAMS = collectd
collectd_CPPFLAGS = $(LTDLINCL)
collectd_CPPFLAGS += -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"'
collectd_CPPFLAGS += -DPKGLOCALSTATEDIR='"${localstatedir}/lib/${PACKAGE_NAME}"'
+if BUILD_FEATURE_DAEMON
collectd_CPPFLAGS += -DPIDFILE='"${localstatedir}/run/${PACKAGE_NAME}.pid"'
+endif
collectd_CPPFLAGS += -DPLUGINDIR='"${pkglibdir}"'
+if BUILD_FEATURE_DEBUG
+collectd_CPPFLAGS += -DLOGFILE='"${localstatedir}/log/${PACKAGE_NAME}/collectd.log"'
+endif
collectd_LDFLAGS = -export-dynamic
--collectd_CFLAGS = -Werror
- collectd_LDADD = $(LIBLTDL) "-dlopen" self
- collectd_DEPENDENCIES = $(LIBLTDL)
++collectd_CFLAGS = -Wall -Werror
+ collectd_LDADD = $(LIBLTDL) libconfig/libconfig.la "-dlopen" self
+ collectd_DEPENDENCIES = $(LIBLTDL) libconfig/libconfig.la
-if BUILD_WITH_RRDTOOL
-collectd_LDADD += -lrrd
-endif
pkglib_LTLIBRARIES =
pkglib_LTLIBRARIES += users.la
users_la_SOURCES = users.c users.h
users_la_LDFLAGS = -module -avoid-version
--users_la_CFLAGS = -Werror
++users_la_CFLAGS = -Wall -Werror
collectd_LDADD += "-dlopen" users.la
collectd_DEPENDENCIES += users.la
endif
diff --cc src/collectd.c
index 76c62d9c977f12fa145a7e34daf0f31f10720e86,af6a93e09e7b4664580cbaad98c1fa8c439c5b31..c86a67803ade6fd7b686de0d67007a9316a9b9e1
--- 1/src/collectd.c
--- 2/src/collectd.c
+++ b/src/collectd.c
case 'h':
default:
exit_usage (argv[0]);
- }
-
- }
+ } /* switch (c) */
+ } /* while (1) */
+
+ DBG_STARTFILE(logfile, "debug file opened.");
/*
- * Load plugins and change to output directory
- * Loading plugins is done first so relative paths work as expected..
+ * Read the config file. This will load any modules automagically.
*/
- if (plugin_load_all (plugindir) < 1)
+ plugin_set_dir (plugindir);
+
+ if (cf_read (configfile))
{
- fprintf (stderr, "Error: No plugins found.\n");
+ fprintf (stderr, "Error: Reading the config file failed!\n"
+ "Read the syslog for details.\n");
return (1);
}