From b58c758b39fb62ee6fbd417f9b991c442781d504 Mon Sep 17 00:00:00 2001 From: Arnaud ANDRE Date: Thu, 31 Dec 2015 14:43:07 +0100 Subject: [PATCH] Add PATHRUN. Use PATH and PATHRUN instead of absolute path for some files (pidfile, script) --- Makefile.am | 2 +- uvrrpd.h | 2 +- vrrp_options.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 3c084f4..fc56307 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ ACLOCAL_AMFLAGS = -I config sbin_SCRIPTS = vrrp_switch.sh EXTRA_DIST = vrrp_switch.sh -AM_CPPFLAGS = $(DEBUG_OPTS) -DPATH="$(sbindir)" +AM_CPPFLAGS = $(DEBUG_OPTS) -DPATH="$(sbindir)" -DPATHRUN="$(localestatedir)/run" AM_CFLAGS = -Wall -W -Werror diff --git a/uvrrpd.h b/uvrrpd.h index 901d9ad..ef4048b 100644 --- a/uvrrpd.h +++ b/uvrrpd.h @@ -24,7 +24,7 @@ #include "bits.h" -#define PIDFILE_NAME "/var/run/uvrrpd_%d.pid" +#define PIDFILE_NAME stringify(PATHRUN) "/uvrrpd_%d.pid" /** * uvrrpd_control diff --git a/vrrp_options.c b/vrrp_options.c index 76cdf68..f7f3d56 100644 --- a/vrrp_options.c +++ b/vrrp_options.c @@ -58,9 +58,9 @@ static void vrrp_usage(void) " -6, --ipv6 IPv6 support, (only in VRRPv3)\n" " -a, --auth pass Simple text password (only in VRRPv2)\n" " -f, --foreground Execute uvrrpd in foreground\n" - " -s, --script Path of hook script (default /etc/uvrrpd/uvrrpd-switch.sh)\n" + " -s, --script Path of hook script (default "stringify(PATH)"/vrrp-switch.sh)\n" " -F --pidfile name Create pid file 'name'\n" - " Default /var/run/uvrrp_${vrid}.pid\n" + " Default "stringify(PATHRUN)"/uvrrp_${vrid}.pid\n" " -d, --debug\n" " -h, --help\n"); }