diff --git a/exec/Makefile.am b/exec/Makefile.am index d4c66d42..51861c14 100644 --- a/exec/Makefile.am +++ b/exec/Makefile.am @@ -32,7 +32,7 @@ MAINTAINERCLEANFILES = Makefile.in AM_CFLAGS = -fPIC -AM_CPPFLAGS = -DSYSCONFDIR=\"${sysconfdir}\" -DLCRSODIR=\"${LCRSODIR}\" +AM_CPPFLAGS = -DSYSCONFDIR=\"${sysconfdir}\" -DLCRSODIR=\"${LCRSODIR}\" -DLOCALSTATEDIR=\"${localstatedir}\" INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include LCR_SRC = objdb.c vsf_ykd.c coroparse.c quorum.c vsf_quorum.c diff --git a/exec/ipc.c b/exec/ipc.c index ef3688ae..3bdf1078 100644 --- a/exec/ipc.c +++ b/exec/ipc.c @@ -689,7 +689,7 @@ static int conn_info_create (int fd) #if defined(COROSYNC_LINUX) const char *socketname = "libais.socket"; #else -const char *socketname = "/var/run/libais.socket"; +const char *socketname = LOCALSTATEDIR "/run/libais.socket"; #endif static int poll_handler_accept ( diff --git a/exec/main.c b/exec/main.c index 3d06d87f..b6d430a5 100644 --- a/exec/main.c +++ b/exec/main.c @@ -169,7 +169,7 @@ static void sigsegv_handler (int num) { (void)signal (SIGSEGV, SIG_DFL); logsys_atsegv(); - logsys_log_rec_store ("/var/lib/corosync/fdata"); + logsys_log_rec_store (LOCALSTATEDIR "/lib/corosync/fdata"); raise (SIGSEGV); } @@ -177,7 +177,7 @@ static void sigabrt_handler (int num) { (void)signal (SIGABRT, SIG_DFL); logsys_atsegv(); - logsys_log_rec_store ("/var/lib/corosync/fdata"); + logsys_log_rec_store (LOCALSTATEDIR "/lib/corosync/fdata"); raise (SIGABRT); } diff --git a/exec/totemsrp.c b/exec/totemsrp.c index bb966ea1..7f9eb8a9 100644 --- a/exec/totemsrp.c +++ b/exec/totemsrp.c @@ -718,7 +718,7 @@ int totemsrp_initialize ( rundir = getenv ("COROSYNC_RUN_DIR"); if (rundir == NULL) { - rundir = "/var/lib/corosync"; + rundir = LOCALSTATEDIR "/lib/corosync"; } res = mkdir (rundir, 0700); diff --git a/lcr/Makefile.am b/lcr/Makefile.am index 2081dcb2..c18f7a65 100644 --- a/lcr/Makefile.am +++ b/lcr/Makefile.am @@ -31,7 +31,7 @@ MAINTAINERCLEANFILES = Makefile.in AM_CFLAGS = -fPIC -AM_CPPFLAGS = -DLCRSODIR=\"${LCRSODIR}\" +AM_CPPFLAGS = -DLCRSODIR=\"${LCRSODIR}\" -DLOCALSTATEDIR=\"${localstatedir}\" INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include LCRSO = libtest_a.lcrso libtest_b.lcrso diff --git a/lcr/uic.c b/lcr/uic.c index 2f77566c..4fd64265 100755 --- a/lcr/uic.c +++ b/lcr/uic.c @@ -59,7 +59,7 @@ #ifdef COROSYNC_LINUX static const char *socketname = "lcr.socket"; #else -static const char *socketname = "/var/run/lcr.socket"; +static const char *socketname = LOCALSTATEDIR "/run/lcr.socket"; #endif static int uic_connect (int *fd); diff --git a/lcr/uis.c b/lcr/uis.c index ee8b560f..49fa9380 100755 --- a/lcr/uis.c +++ b/lcr/uis.c @@ -61,7 +61,7 @@ #ifdef COROSYNC_LINUX static char *socketname = "lcr.socket"; #else -static char *socketname = "/var/run/lcr.socket"; +static char *socketname = LOCALSTATEDIR "/run/lcr.socket"; #endif static void uis_lcr_bind (int *server_fd) diff --git a/lib/coroipc.c b/lib/coroipc.c index 59997306..09247de0 100644 --- a/lib/coroipc.c +++ b/lib/coroipc.c @@ -93,7 +93,7 @@ static const char *socketname = "libais.socket"; #else #define AIS_SUN_LEN(a) SUN_LEN(a) -static const char *socketname = "/var/run/libais.socket"; +static const char *socketname = LOCALSTATEDIR "/run/libais.socket"; #endif #ifdef SO_NOSIGPIPE diff --git a/tools/Makefile.am b/tools/Makefile.am index fb5c9204..6dfb78b2 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -32,7 +32,7 @@ MAINTAINERCLEANFILES = Makefile.in INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -AM_CPPFLAGS = -DSYSCONFDIR=\"${sysconfdir}\" +AM_CPPFLAGS = -DSYSCONFDIR=\"${sysconfdir}\" -DLOCALSTATEDIR=\"${localstatedir}\" sbin_PROGRAMS = corosync-fplay corosync-cfgtool \ corosync-keygen corosync-objctl \ diff --git a/tools/corosync-fplay.c b/tools/corosync-fplay.c index b9c72724..aa0f8665 100644 --- a/tools/corosync-fplay.c +++ b/tools/corosync-fplay.c @@ -456,7 +456,7 @@ int main (void) int size_read; flt_data = malloc ((flt_data_size + 2) * sizeof (unsigned int)); - fd = open ("/var/lib/corosync/fdata", O_RDONLY); + fd = open (LOCALSTATEDIR "/lib/corosync/fdata", O_RDONLY); size_read = (int)read (fd, flt_data, (flt_data_size + 2) * sizeof (unsigned int)); if (size_read != (flt_data_size + 2) * sizeof (unsigned int)) {