summaryrefslogtreecommitdiff
path: root/isisd
diff options
context:
space:
mode:
authorhasso <hasso>2004-02-20 18:44:21 +0000
committerhasso <hasso>2004-02-20 18:44:21 +0000
commitc3aac6ff4f67d2dff5288e55be1853abc61f40e5 (patch)
tree017cce5798630505ad0daa3a92f5b078515fda8a /isisd
parenteb26037b73991750392c6deaad09f2fd7600ebee (diff)
Fix vty address handling and added pid file stuff.
Diffstat (limited to 'isisd')
-rw-r--r--isisd/isis_main.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/isisd/isis_main.c b/isisd/isis_main.c
index 51249c5d..b952c00c 100644
--- a/isisd/isis_main.c
+++ b/isisd/isis_main.c
@@ -78,6 +78,8 @@ struct option longopts[] =
{
{ "daemon", no_argument, NULL, 'd'},
{ "config_file", required_argument, NULL, 'f'},
+ { "pid_file", required_argument, NULL, 'i'},
+ { "vty_addr", required_argument, NULL, 'A'},
{ "vty_port", required_argument, NULL, 'P'},
{ "user", required_argument, NULL, 'u'},
{ "version", no_argument, NULL, 'v'},
@@ -98,6 +100,8 @@ int daemon_mode = 0;
/* Master of threads. */
struct thread_master *master;
+/* Process ID saved for use by init system */
+char *pid_file = PATH_ISISD_PID;
/* for reload */
char _cwd[64];
@@ -119,6 +123,8 @@ usage (int status)
Daemon which manages IS-IS routing\n\n\
-d, --daemon Runs in daemon mode\n\
-f, --config_file Set configuration file name\n\
+-i, --pid_file Set process identifier file name\n\
+-A, --vty_addr Set vty's bind address\n\
-P, --vty_port Set vty's port number\n\
-u, --user User and group to run as\n\
-v, --version Print program version\n\
@@ -234,7 +240,7 @@ main (int argc, char **argv, char **envp)
/* Command line argument treatment. */
while (1)
{
- opt = getopt_long (argc, argv, "df:hAp:P:u:v", longopts, 0);
+ opt = getopt_long (argc, argv, "df:i:hA:p:P:u:v", longopts, 0);
if (opt == EOF)
break;
@@ -249,6 +255,9 @@ main (int argc, char **argv, char **envp)
case 'f':
config_file = optarg;
break;
+ case 'i':
+ pid_file = optarg;
+ break;
case 'A':
vty_addr = optarg;
break;
@@ -313,7 +322,7 @@ main (int argc, char **argv, char **envp)
daemon (0, 0);
/* Process ID file creation. */
- pid_output (PATH_ISISD_PID);
+ pid_output (pid_file);
/* Make isis vty socket. */
vty_serv_sock (vty_addr, vty_port, ISIS_VTYSH_PATH);