From: octo Date: Fri, 16 Dec 2005 10:22:58 +0000 (+0000) Subject: Changed the merger to fit better with the configfile concept X-Git-Tag: collectd-3.5.0~7^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cc0d31d626faaedad019aa9a68bea64cbeefc7e2;p=collectd.git Changed the merger to fit better with the configfile concept SYSCONFDIR -> CONFIGFILE LOCALSTATEDIR: var -> var/lib --- diff --git a/src/Makefile.am b/src/Makefile.am index 186c19b2..1d246a91 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -15,8 +15,8 @@ collectd_SOURCES = collectd.c collectd.h \ 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 394ac843..8e92bfbc 100644 --- a/src/collectd.c +++ b/src/collectd.c @@ -121,7 +121,7 @@ void exit_usage (char *name) "Available options:\n" " General:\n" - " -C Configuration directory.\n" + " -C Configuration file.\n" " Default: %s\n" " -P PID File.\n" " Default: %s\n" @@ -143,7 +143,7 @@ void exit_usage (char *name) "\n%s %s, http://verplant.org/collectd/\n" "by Florian octo Forster \n" "for contributions see `AUTHORS'\n", - PACKAGE, SYSCONFDIR, PIDFILE, PLUGINDIR, PKGLOCALSTATEDIR, PACKAGE, VERSION); + PACKAGE, CONFIGFILE, PIDFILE, PLUGINDIR, PKGLOCALSTATEDIR, PACKAGE, VERSION); exit (0); } @@ -243,10 +243,10 @@ int main (int argc, char **argv) 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; @@ -290,7 +290,7 @@ int main (int argc, char **argv) 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 7a3eb8d5..7f163bd5 100644 --- a/src/collectd.h +++ b/src/collectd.h @@ -164,14 +164,34 @@ #include #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