mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-10-19 10:22:42 +00:00
watchfrr: remove STATEDIR preprocessor define
use frr_vtydir from libfrr instead. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
b8c1fde3cb
commit
64a249ad9e
@ -1,8 +1,6 @@
|
|||||||
## Process this file with Automake to create Makefile.in
|
## Process this file with Automake to create Makefile.in
|
||||||
|
|
||||||
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
|
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
|
||||||
DEFS = @DEFS@ -DSTATEDIR=\"$(localstatedir)/\"
|
|
||||||
|
|
||||||
AM_CFLAGS = $(WERROR)
|
AM_CFLAGS = $(WERROR)
|
||||||
|
|
||||||
sbin_PROGRAMS = watchfrr
|
sbin_PROGRAMS = watchfrr
|
||||||
|
@ -50,21 +50,12 @@
|
|||||||
#define DEFAULT_LOGLEVEL LOG_INFO
|
#define DEFAULT_LOGLEVEL LOG_INFO
|
||||||
#define DEFAULT_MIN_RESTART 60
|
#define DEFAULT_MIN_RESTART 60
|
||||||
#define DEFAULT_MAX_RESTART 600
|
#define DEFAULT_MAX_RESTART 600
|
||||||
#ifdef PATH_WATCHFRR_PID
|
|
||||||
#define DEFAULT_PIDFILE PATH_WATCHFRR_PID
|
|
||||||
#else
|
|
||||||
#define DEFAULT_PIDFILE STATEDIR "/watchfrr.pid"
|
|
||||||
#endif
|
|
||||||
#ifdef DAEMON_VTY_DIR
|
|
||||||
#define VTYDIR DAEMON_VTY_DIR
|
|
||||||
#else
|
|
||||||
#define VTYDIR STATEDIR
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define PING_TOKEN "PING"
|
#define PING_TOKEN "PING"
|
||||||
|
|
||||||
/* Needs to be global, referenced somewhere inside libfrr. */
|
/* Needs to be global, referenced somewhere inside libfrr. */
|
||||||
struct thread_master *master;
|
struct thread_master *master;
|
||||||
|
static char pidfile_default[256];
|
||||||
|
|
||||||
static bool watch_only = false;
|
static bool watch_only = false;
|
||||||
|
|
||||||
@ -118,7 +109,7 @@ static struct global_state {
|
|||||||
int numdown; /* # of daemons that are not UP or UNRESPONSIVE */
|
int numdown; /* # of daemons that are not UP or UNRESPONSIVE */
|
||||||
} gs = {
|
} gs = {
|
||||||
.phase = PHASE_NONE,
|
.phase = PHASE_NONE,
|
||||||
.vtydir = VTYDIR,
|
.vtydir = frr_vtydir,
|
||||||
.period = 1000 * DEFAULT_PERIOD,
|
.period = 1000 * DEFAULT_PERIOD,
|
||||||
.timeout = DEFAULT_TIMEOUT,
|
.timeout = DEFAULT_TIMEOUT,
|
||||||
.restart_timeout = DEFAULT_RESTART_TIMEOUT,
|
.restart_timeout = DEFAULT_RESTART_TIMEOUT,
|
||||||
@ -245,9 +236,9 @@ Otherwise, the interval is doubled (but capped at the -M value).\n\n",
|
|||||||
passing command-line arguments with embedded spaces.\n\
|
passing command-line arguments with embedded spaces.\n\
|
||||||
-v, --version Print program version\n\
|
-v, --version Print program version\n\
|
||||||
-h, --help Display this help and exit\n",
|
-h, --help Display this help and exit\n",
|
||||||
VTYDIR, DEFAULT_LOGLEVEL, LOG_EMERG, LOG_DEBUG, LOG_DEBUG,
|
frr_vtydir, DEFAULT_LOGLEVEL, LOG_EMERG, LOG_DEBUG, LOG_DEBUG,
|
||||||
DEFAULT_MIN_RESTART, DEFAULT_MAX_RESTART, DEFAULT_PERIOD,
|
DEFAULT_MIN_RESTART, DEFAULT_MAX_RESTART, DEFAULT_PERIOD,
|
||||||
DEFAULT_TIMEOUT, DEFAULT_RESTART_TIMEOUT, DEFAULT_PIDFILE);
|
DEFAULT_TIMEOUT, DEFAULT_RESTART_TIMEOUT, pidfile_default);
|
||||||
}
|
}
|
||||||
|
|
||||||
static pid_t run_background(char *shell_cmd)
|
static pid_t run_background(char *shell_cmd)
|
||||||
@ -976,10 +967,13 @@ FRR_DAEMON_INFO(watchfrr, WATCHFRR,
|
|||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int opt;
|
int opt;
|
||||||
const char *pidfile = DEFAULT_PIDFILE;
|
const char *pidfile = pidfile_default;
|
||||||
const char *special = "zebra";
|
const char *special = "zebra";
|
||||||
const char *blankstr = NULL;
|
const char *blankstr = NULL;
|
||||||
|
|
||||||
|
snprintf(pidfile_default, sizeof(pidfile_default), "%s/watchfrr.pid",
|
||||||
|
frr_vtydir);
|
||||||
|
|
||||||
frr_preinit(&watchfrr_di, argc, argv);
|
frr_preinit(&watchfrr_di, argc, argv);
|
||||||
progname = watchfrr_di.progname;
|
progname = watchfrr_di.progname;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user