summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cc348e2)
raw | patch | inline | side by side (parent: cc348e2)
author | octo <octo> | |
Fri, 16 Dec 2005 10:22:58 +0000 (10:22 +0000) | ||
committer | octo <octo> | |
Fri, 16 Dec 2005 10:22:58 +0000 (10:22 +0000) |
SYSCONFDIR -> CONFIGFILE
LOCALSTATEDIR: var -> var/lib
LOCALSTATEDIR: var -> var/lib
src/Makefile.am | patch | blob | history | |
src/collectd.c | patch | blob | history | |
src/collectd.h | patch | blob | history |
diff --git a/src/Makefile.am b/src/Makefile.am
index 186c19b2c0eee9088b63e85a8ca4ed9882f62a04..1d246a915a95f53c330da411f1d8701914029a06 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
configfile.c configfile.h
#collectd_CFLAGS = -DPLUGINDIR='"$(pkglibdir)"'
collectd_CPPFLAGS =
-collectd_CPPFLAGS += -DSYSCONFDIR='"${sysconfdir}"'
-collectd_CPPFLAGS += -DPKGLOCALSTATEDIR='"${localstatedir}/${PACKAGE_NAME}"'
+collectd_CPPFLAGS += -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"'
+collectd_CPPFLAGS += -DPKGLOCALSTATEDIR='"${localstatedir}/lib/${PACKAGE_NAME}"'
collectd_CPPFLAGS += -DPIDFILE='"${localstatedir}/run/${PACKAGE_NAME}.pid"'
collectd_CPPFLAGS += -DPLUGINDIR='"${pkglibdir}"'
collectd_LDFLAGS = -export-dynamic
diff --git a/src/collectd.c b/src/collectd.c
index 394ac84338a0a5914c1d9b74f11e42dc9178110f..8e92bfbc857b77e3eb3c058c6e817300662ab245 100644 (file)
--- a/src/collectd.c
+++ b/src/collectd.c
"Available options:\n"
" General:\n"
- " -C <dir> Configuration directory.\n"
+ " -C <dir> Configuration file.\n"
" Default: %s\n"
" -P <file> PID File.\n"
" Default: %s\n"
"\n%s %s, http://verplant.org/collectd/\n"
"by Florian octo Forster <octo@verplant.org>\n"
"for contributions see `AUTHORS'\n",
- PACKAGE, SYSCONFDIR, PIDFILE, PLUGINDIR, PKGLOCALSTATEDIR, PACKAGE, VERSION);
+ PACKAGE, CONFIGFILE, PIDFILE, PLUGINDIR, PKGLOCALSTATEDIR, PACKAGE, VERSION);
exit (0);
}
pid_t pid;
#endif
- char *confdir = SYSCONFDIR;
- char *pidfile = PIDFILE;
- char *plugindir = PLUGINDIR;
- char *datadir = PKGLOCALSTATEDIR;
+ char *configfile = CONFIGFILE;
+ char *pidfile = PIDFILE;
+ char *plugindir = PLUGINDIR;
+ char *datadir = PKGLOCALSTATEDIR;
int daemonize = 1;
break;
#endif /* HAVE_LIBRRD */
case 'C':
- confdir = optarg;
+ configfile = optarg;
break;
case 'P':
pidfile = optarg;
diff --git a/src/collectd.h b/src/collectd.h
index 7a3eb8d5bb51fa280964d428fa11408936a28535..7f163bd51e24ee8024db416381301d79df3147cb 100644 (file)
--- a/src/collectd.h
+++ b/src/collectd.h
#include <statgrab.h>
#endif
+#ifndef PACKAGE_NAME
+#define PACKAGE_NAME "collectd"
+#endif
+
+#ifndef PREFIX
+#define PREFIX "/opt/" PACKAGE_NAME
+#endif
+
#ifndef SYSCONFDIR
-#define SYSCONFDIR "/opt/collectd/etc"
+#define SYSCONFDIR PREFIX "/etc"
#endif
#ifndef CONFIGFILE
#define CONFIGFILE SYSCONFDIR"/collectd.conf"
#endif
+#ifndef PKGLOCALSTATEDIR
+#define PKGLOCALSTATEDIR PREFIX "/var/lib/" PACKAGE_NAME
+#endif
+
+#ifndef PIDFILE
+#define PIDFILE PREFIX "/var/run/" PACKAGE_NAME ".pid"
+#endif
+
+#ifndef PLUGINDIR
+#define PLUGINDIR PREFIX "/lib/" PACKAGE_NAME
+#endif
+
#define MODE_SERVER 0x01
#define MODE_CLIENT 0x02
#define MODE_LOCAL 0x03