Add PATHRUN. Use PATH and PATHRUN instead of absolute path for some files (pidfile, script)

This commit is contained in:
Arnaud ANDRE 2015-12-31 14:43:07 +01:00
parent 4e083b7392
commit b58c758b39
3 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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

View file

@ -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");
}