From e7121bf4678dc8c502137294a8549d7a1fc4d6f7 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 16 Aug 2018 22:38:52 +0200 Subject: [PATCH] usyslogd: at least create files/sockets relative to prefix path Signed-off-by: David Oberhollenzer --- configure.ac | 2 ++ syslogd/logfile.c | 3 ++- syslogd/main.c | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index e8fade6..b6fee0e 100644 --- a/configure.ac +++ b/configure.ac @@ -58,6 +58,8 @@ AC_DEFINE_DIR(SBINPATH, sbindir, [Fully evaluated sbin directory]) AC_DEFINE_DIR(ETCPATH, sysconfdir, [Fulle evaluated etc directory]) AC_DEFINE_DIR(STATEFILESPATH, prefix/var/lib, [Path for persistent state files]) +AC_DEFINE_DIR(PREFIXPATH, prefix, [Fully expaneded installation prefix]) + AC_CONFIG_FILES([services/sigkill]) AC_CONFIG_FILES([services/sigterm]) AC_CONFIG_FILES([services/sysfs]) diff --git a/syslogd/logfile.c b/syslogd/logfile.c index 606db8e..6479bb5 100644 --- a/syslogd/logfile.c +++ b/syslogd/logfile.c @@ -25,10 +25,11 @@ #include #include "backend.h" +#include "config.h" #include "util.h" -#define SYSLOG_PATH "/var/log" +#define SYSLOG_PATH PREFIXPATH "/var/log" static const enum_map_t levels[] = { diff --git a/syslogd/main.c b/syslogd/main.c index 7a466d6..e89b287 100644 --- a/syslogd/main.c +++ b/syslogd/main.c @@ -31,7 +31,7 @@ #include "util.h" -#define SYSLOG_SOCKET "/dev/log" +#define SYSLOG_SOCKET PREFIXPATH "/dev/log" #define GPL_URL "https://gnu.org/licenses/gpl.html"