From ac9ed56d887357049bae1bc901e80b58961d6380 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Wed, 14 Oct 2009 18:13:29 +0200 Subject: lib: fs namespacing 2/5: use path_state for vty paths use the path_state helper functions for determining vty socket paths in all quagga daemons. this allows for running multiple daemons if a namespace name is set. --- isisd/Makefile.am | 1 - isisd/isis_main.c | 18 ++++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'isisd') diff --git a/isisd/Makefile.am b/isisd/Makefile.am index 9c303390..a7117fd6 100644 --- a/isisd/Makefile.am +++ b/isisd/Makefile.am @@ -2,7 +2,6 @@ INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib \ @ISIS_TOPOLOGY_INCLUDES@ -DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" INSTALL_SDATA=@INSTALL@ -m 600 LIBS = @LIBS@ diff --git a/isisd/isis_main.c b/isisd/isis_main.c index c5e824c1..b924b77f 100644 --- a/isisd/isis_main.c +++ b/isisd/isis_main.c @@ -34,6 +34,7 @@ #include "privs.h" #include "sigevent.h" #include "filter.h" +#include "paths.h" #include "isisd/dict.h" #include "include-netbsd/iso.h" @@ -45,7 +46,10 @@ #include "isisd/isis_dynhn.h" /* Default configuration file name */ -#define ISISD_DEFAULT_CONFIG "isisd.conf" +#define ISISD_CONFIG_NAME "isisd.conf" +#define ISISD_PID_NAME "isisd.pid" +#define ISISD_VTY_NAME "isisd.vty" + /* Default vty port */ #define ISISD_VTY_PORT 2608 @@ -86,7 +90,7 @@ struct option longopts[] = { }; /* Configuration file and directory. */ -char config_default[] = SYSCONFDIR ISISD_DEFAULT_CONFIG; +char config_default[MAXPATHLEN]; char *config_file = NULL; /* isisd program name. */ @@ -97,8 +101,11 @@ int daemon_mode = 0; /* Master of threads. */ struct thread_master *master; +/* pid_file default value */ +static char pid_file_default[MAXPATHLEN]; + /* Process ID saved for use by init system */ -const char *pid_file = PATH_ISISD_PID; +const char *pid_file = pid_file_default; /* for reload */ char _cwd[MAXPATHLEN]; @@ -303,6 +310,9 @@ main (int argc, char **argv, char **envp) } } + strcpy (config_default, path_config (ISISD_CONFIG_NAME)); + strcpy (pid_file_default, path_state (ISISD_PID_NAME)); + /* thread master */ master = thread_master_create (); @@ -343,7 +353,7 @@ main (int argc, char **argv, char **envp) pid_output (pid_file); /* Make isis vty socket. */ - vty_serv_sock (vty_addr, vty_port, ISIS_VTYSH_PATH); + vty_serv_sock (vty_addr, vty_port, path_state (ISISD_VTY_NAME)); /* Print banner. */ zlog_notice ("Quagga-ISISd %s starting: vty@%d", QUAGGA_VERSION, vty_port); -- cgit v1.2.3