diff options
author | David Lamparter <equinox@diac24.net> | 2009-10-14 18:13:29 +0200 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2010-02-04 02:53:48 +0100 |
commit | ac9ed56d887357049bae1bc901e80b58961d6380 (patch) | |
tree | a5cd31094ee55324fe6a57212c03c6f7828673c4 /ripngd/ripng_main.c | |
parent | f99eea6053507e6dbd5ad22f4c7ba80c5a981651 (diff) | |
download | quagga-ac9ed56d887357049bae1bc901e80b58961d6380.tar.bz2 quagga-ac9ed56d887357049bae1bc901e80b58961d6380.tar.xz |
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.
Diffstat (limited to 'ripngd/ripng_main.c')
-rw-r--r-- | ripngd/ripng_main.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/ripngd/ripng_main.c b/ripngd/ripng_main.c index 85209a15..54e3b69d 100644 --- a/ripngd/ripng_main.c +++ b/ripngd/ripng_main.c @@ -38,7 +38,7 @@ #include "ripngd/ripngd.h" /* Configuration filename and directory. */ -char config_default[] = SYSCONFDIR RIPNG_DEFAULT_CONFIG; +char config_default[MAXPATHLEN]; char *config_file = NULL; /* RIPngd options. */ @@ -96,8 +96,11 @@ int vty_port = RIPNG_VTY_PORT; /* 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_RIPNGD_PID; +const char *pid_file = pid_file_default; /* Help information display. */ static void @@ -137,7 +140,7 @@ sighup (void) /* Reload config file. */ vty_read_config (config_file, config_default); /* Create VTY's socket */ - vty_serv_sock (vty_addr, vty_port, RIPNG_VTYSH_PATH); + vty_serv_sock (vty_addr, vty_port, path_state (RIPNG_VTY_NAME)); /* Try to return to normal operation. */ } @@ -263,6 +266,9 @@ main (int argc, char **argv) } } + strcpy (config_default, path_config (RIPNG_CONFIG_NAME)); + strcpy (pid_file_default, path_state (RIPNG_PID_NAME)); + master = thread_master_create (); /* Library inits. */ @@ -295,7 +301,7 @@ main (int argc, char **argv) } /* Create VTY socket */ - vty_serv_sock (vty_addr, vty_port, RIPNG_VTYSH_PATH); + vty_serv_sock (vty_addr, vty_port, path_state (RIPNG_VTY_NAME)); /* Process id file create. */ pid_output (pid_file); |