Skip to content

Commit

Permalink
Make group to run daemon as configurable. Fixes #2 from Bugzilla FRRo…
Browse files Browse the repository at this point in the history
  • Loading branch information
hasso committed Nov 25, 2004
1 parent accb156 commit c065230
Show file tree
Hide file tree
Showing 22 changed files with 156 additions and 56 deletions.
4 changes: 4 additions & 0 deletions bgpd/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2004-11-25 Hasso Tepper <hasso at quagga.net>

* bgp_main.c: Make group to run as configurable.

2004-11-09 Paul Jakma <paul@dishone.st>

* bgp_nexthop.c: collapse bgp_connected_ipvX, bgp_nexthop_cache_ipvX
Expand Down
15 changes: 10 additions & 5 deletions bgpd/bgp_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ struct option longopts[] =
{ "retain", no_argument, NULL, 'r'},
{ "no_kernel", no_argument, NULL, 'n'},
{ "user", required_argument, NULL, 'u'},
{ "group", required_argument, NULL, 'g'},
{ "version", no_argument, NULL, 'v'},
{ "help", no_argument, NULL, 'h'},
{ 0 }
Expand Down Expand Up @@ -137,7 +138,8 @@ redistribution between different routing protocols.\n\n\
-P, --vty_port Set vty's port number\n\
-r, --retain When program terminates, retain added route by bgpd.\n\
-n, --no_kernel Do not install route to kernel.\n\
-u, --user User and group to run as\n\
-u, --user User to run as\n\
-g, --group Group to run as\n\
-v, --version Print program version\n\
-h, --help Display this help and exit\n\
\n\
Expand Down Expand Up @@ -212,7 +214,7 @@ main (int argc, char **argv)
/* Command line argument treatment. */
while (1)
{
opt = getopt_long (argc, argv, "df:i:hp:A:P:rnu:v", longopts, 0);
opt = getopt_long (argc, argv, "df:i:hp:A:P:rnu:g:v", longopts, 0);

if (opt == EOF)
break;
Expand Down Expand Up @@ -253,9 +255,12 @@ main (int argc, char **argv)
case 'n':
bgp_option_set (BGP_OPT_NO_FIB);
break;
case 'u':
bgpd_privs.user = bgpd_privs.group = optarg;
break;
case 'u':
bgpd_privs.user = optarg;
break;
case 'g':
bgpd_privs.group = optarg;
break;
case 'v':
print_version (progname);
exit (0);
Expand Down
5 changes: 5 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2004-11-25 Hasso Tepper <hasso at quagga.net>

* *.8: Document -g/--group command line switch and some small
cosmetical changes.

2004-11-22 Paul Jakma <paul@dishone.st>

* bgpd.8: escape -/+ signs, reported by ESR to bug-zebra.
Expand Down
16 changes: 9 additions & 7 deletions doc/bgpd.8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH BGPD 8 "10 August 2004" "Quagga BGPD daemon" "Version 0.96.5"
.TH BGPD 8 "25 November 2004" "Quagga BGPD daemon" "Version 0.97.3"
.SH NAME
bgpd \- a BGPv4, BGPv4\+, BGPv4\- routing engine for use with Quagga routing
software
Expand All @@ -17,9 +17,6 @@ software
.B \-p
.I bgp-port-number
] [
.B \--bgp_port=
.I port-number
] [
.B \-P
.I port-number
] [
Expand All @@ -28,6 +25,9 @@ software
] [
.B \-u
.I user
] [
.B \-g
.I group
]
.SH DESCRIPTION
.B bgpd
Expand All @@ -46,6 +46,9 @@ Runs in daemon mode, forking and exiting from tty.
Specifies the config file to use for startup. If not specified this
option will likely default to \fB\fI/usr/local/etc/bgpd.conf\fR.
.TP
\fB\-g\fR, \fB\-\-group \fR\fIgroup\fR
Specify the group to run as. Default is \fIquagga\fR.
.TP
\fB\-h\fR, \fB\-\-help\fR
A brief message.
.TP
Expand All @@ -54,7 +57,7 @@ When bgpd starts its process idenifier is written to
\fB\fIpid-file\fR. The init system uses the recorded PID to stop or
restart bgpd. The likely default is \fB\fI/var/run/bgpd.pid\fR.
.TP
\fB\-p\fR, \fB\-\-bgp_port=\fR\fIport\fR
\fB\-p\fR, \fB\-\-bgp_port \fR\fIbgp-port-number\fR
Set the port that bgpd will listen to for bgp data.
.TP
\fB\-P\fR, \fB\-\-vty_port \fR\fIport-number\fR
Expand All @@ -66,8 +69,7 @@ Specify the address that the bgpd VTY will listen on. Default is all
intrefaces.
.TP
\fB\-u\fR, \fB\-\-user \fR\fIuser\fR
Specify the user and group to run as. User and group have to have same
name at the moment. Default is \fIquagga\fR.
Specify the user to run as. Default is \fIquagga\fR.
.TP
\fB\-r\fR, \fB\-\-retain\fR
When the program terminates, retain routes added by \fBbgpd\fR.
Expand Down
11 changes: 8 additions & 3 deletions doc/isisd.8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH IS-IS 8 "10 August 2004" "Quagga IS-IS daemon" "Version 0.96.5"
.TH IS-IS 8 "25 November 2004" "Quagga IS-IS daemon" "Version 0.97.3"
.SH NAME
isisd \- an IS-IS routing engine for use with Quagga routing software.
.SH SYNOPSIS
Expand All @@ -20,6 +20,9 @@ isisd \- an IS-IS routing engine for use with Quagga routing software.
] [
.B \-u
.I user
] [
.B \-g
.I group
]
.SH DESCRIPTION
.B isisd
Expand All @@ -38,6 +41,9 @@ Runs in daemon mode, forking and exiting from tty.
Specifies the config file to use for startup. If not specified this
option will likely default to \fB\fI/usr/local/etc/isisd.conf\fR.
.TP
\fB\-g\fR, \fB\-\-group \fR\fIgroup\fR
Specify the group to run as. Default is \fIquagga\fR.
.TP
\fB\-h\fR, \fB\-\-help\fR
A brief message.
.TP
Expand All @@ -55,8 +61,7 @@ Specify the address that the isisd VTY will listen on. Default is all
intrefaces.
.TP
\fB\-u\fR, \fB\-\-user \fR\fIuser\fR
Specify the user and group to run as. User and group have to have same
name at the moment. Default is \fIquagga\fR.
Specify the user to run as. Default is \fIquagga\fR.
.TP
\fB\-v\fR, \fB\-\-version\fR
Print the version and exit.
Expand Down
11 changes: 8 additions & 3 deletions doc/ospf6d.8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH OSPF6D 8 "10 August 2004" "Quagga OSPFv3 daemon" "Version 0.96.5"
.TH OSPF6D 8 "25 November 2004" "Quagga OSPFv3 daemon" "Version 0.97.3"
.SH NAME
ospf6d \- an OSPFv3 routing engine for use with Quagga routing software.
.SH SYNOPSIS
Expand All @@ -20,6 +20,9 @@ ospf6d \- an OSPFv3 routing engine for use with Quagga routing software.
] [
.B \-u
.I user
] [
.B \-g
.I group
]
.SH DESCRIPTION
.B ospf6d
Expand All @@ -39,6 +42,9 @@ Runs in daemon mode, forking and exiting from tty.
Specifies the config file to use for startup. If not specified this
option will likely default to \fB\fI/usr/local/etc/ospf6d.conf\fR.
.TP
\fB\-g\fR, \fB\-\-group \fR\fIgroup\fR
Specify the group to run as. Default is \fIquagga\fR.
.TP
\fB\-h\fR, \fB\-\-help\fR
A brief message.
.TP
Expand All @@ -56,8 +62,7 @@ Specify the address that the ospf6d VTY will listen on. Default is all
intrefaces.
.TP
\fB\-u\fR, \fB\-\-user \fR\fIuser\fR
Specify the user and group to run as. User and group have to have same
name at the moment. Default is \fIquagga\fR.
Specify the user to run as. Default is \fIquagga\fR.
.TP
\fB\-v\fR, \fB\-\-version\fR
Print the version and exit.
Expand Down
11 changes: 8 additions & 3 deletions doc/ospfd.8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH OSPFD 8 "10 August 2004" "Quagga OSPFv2 daemon" "Version 0.96.5"
.TH OSPFD 8 "25 November 2004" "Quagga OSPFv2 daemon" "Version 0.97.3"
.SH NAME
ospfd \- an OSPFv2 routing engine for use with Quagga routing software.
.SH SYNOPSIS
Expand All @@ -20,6 +20,9 @@ ospfd \- an OSPFv2 routing engine for use with Quagga routing software.
] [
.B \-u
.I user
] [
.B \-g
.I group
]
.SH DESCRIPTION
.B ospfd
Expand All @@ -38,6 +41,9 @@ Runs in daemon mode, forking and exiting from tty.
Specifies the config file to use for startup. If not specified this
option will likely default to \fB\fI/usr/local/etc/ospfd.conf\fR.
.TP
\fB\-g\fR, \fB\-\-group \fR\fIgroup\fR
Specify the group to run as. Default is \fIquagga\fR.
.TP
\fB\-h\fR, \fB\-\-help\fR
A brief message.
.TP
Expand All @@ -58,8 +64,7 @@ Specify the address that the ospfd VTY will listen on. Default is all
intrefaces.
.TP
\fB\-u\fR, \fB\-\-user \fR\fIuser\fR
Specify the user and group to run as. User and group have to have same
name at the moment. Default is \fIquagga\fR.
Specify the user to run as. Default is \fIquagga\fR.
.TP
\fB\-a\fR, \fB\-\-apiserver \fR
Enable OSPF apiserver. Default is disabled.
Expand Down
14 changes: 10 additions & 4 deletions doc/ripd.8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH RIPD 8 "10 August 2004" "Quagga RIP daemon" "Version 0.96.5"
.TH RIPD 8 "25 November 2004" "Quagga RIP daemon" "Version 0.97.3"
.SH NAME
ripd \- a RIP routing engine for use with Quagga routing software.
.SH SYNOPSIS
Expand All @@ -20,6 +20,9 @@ ripd \- a RIP routing engine for use with Quagga routing software.
] [
.B \-u
.I user
] [
.B \-g
.I group
]
.SH DESCRIPTION
.B ripd
Expand All @@ -36,7 +39,11 @@ command:
Runs in daemon mode, forking and exiting from tty.
.TP
\fB\-f\fR, \fB\-\-config-file \fR\fIconfig-file\fR
Specifies the config file to use for startup. If not specified this option will likely default to \fB\fI/usr/local/etc/ripd.conf\fR.
Specifies the config file to use for startup. If not specified this
option will likely default to \fB\fI/usr/local/etc/ripd.conf\fR.
.TP
\fB\-g\fR, \fB\-\-group \fR\fIgroup\fR
Specify the group to run as. Default is \fIquagga\fR.
.TP
\fB\-h\fR, \fB\-\-help\fR
A brief message.
Expand All @@ -55,8 +62,7 @@ Specify the address that the ripd VTY will listen on. Default is all
intrefaces.
.TP
\fB\-u\fR, \fB\-\-user \fR\fIuser\fR
Specify the user and group to run as. User and group have to have same
name at the moment. Default is \fIquagga\fR.
Specify the user to run as. Default is \fIquagga\fR.
.TP
\fB\-r\fR, \fB\-\-retain\fR
When the program terminates, retain routes added by \fBripd\fR.
Expand Down
11 changes: 8 additions & 3 deletions doc/ripngd.8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH RIPNGD 8 "10 August 2004" "Quagga RIPNG daemon" "Version 0.96.5"
.TH RIPNGD 8 "25 November 2004" "Quagga RIPNG daemon" "Version 0.97.3"
.SH NAME
ripngd \- a RIPNG routing engine for use with Quagga routing software.
.SH SYNOPSIS
Expand All @@ -20,6 +20,9 @@ ripngd \- a RIPNG routing engine for use with Quagga routing software.
] [
.B \-u
.I user
] [
.B \-g
.I group
]
.SH DESCRIPTION
.B ripngd
Expand All @@ -39,6 +42,9 @@ Runs in daemon mode, forking and exiting from tty.
Specifies the config file to use for startup. If not specified this
option will likely default to \fB\fI/usr/local/etc/ripngd.conf\fR.
.TP
\fB\-g\fR, \fB\-\-group \fR\fIgroup\fR
Specify the group to run as. Default is \fIquagga\fR.
.TP
\fB\-h\fR, \fB\-\-help\fR
A brief message.
.TP
Expand All @@ -59,8 +65,7 @@ Specify the address that the ripngd VTY will listen on. Default is all
intrefaces.
.TP
\fB\-u\fR, \fB\-\-user \fR\fIuser\fR
Specify the user and group to run as. User and group have to have same
name at the moment. Default is \fIquagga\fR.
Specify the user to run as. Default is \fIquagga\fR.
.TP
\fB\-r\fR, \fB\-\-retain\fR
When the program terminates, retain routes added by \fBripd\fR.
Expand Down
14 changes: 10 additions & 4 deletions doc/zebra.8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH ZEBRA 8 "10 August 2004" "Zebra daemon" "Version 0.96.5"
.TH ZEBRA 8 "25 November 2004" "Zebra daemon" "Version 0.97.3"
.SH NAME
zebra \- a routing manager for use with associated Quagga components.
.SH SYNOPSIS
Expand All @@ -20,6 +20,9 @@ zebra \- a routing manager for use with associated Quagga components.
] [
.B \-u
.I user
] [
.B \-g
.I group
]
.SH DESCRIPTION
.B zebra
Expand All @@ -40,7 +43,11 @@ Runs in batch mode, \fBzebra\fR parses its config and exits.
Runs in daemon mode, forking and exiting from tty.
.TP
\fB\-f\fR, \fB\-\-config-file \fR\fIconfig-file\fR
Specifies the config file to use for startup. If not specified this option will likely default to \fB\fI/usr/local/etc/zebra.conf\fR.
Specifies the config file to use for startup. If not specified this
option will likely default to \fB\fI/usr/local/etc/zebra.conf\fR.
.TP
\fB\-g\fR, \fB\-\-group \fR\fIgroup\fR
Specify the group to run as. Default is \fIquagga\fR.
.TP
\fB\-h\fR, \fB\-\-help\fR
A brief message.
Expand All @@ -65,8 +72,7 @@ Specify the address that the zebra VTY will listen on. Default is all
intrefaces.
.TP
\fB\-u\fR, \fB\-\-user \fR\fIuser\fR
Specify the user and group to run as. User and group have to have same
name at the moment. Default is \fIquagga\fR.
Specify the user to run as. Default is \fIquagga\fR.
.TP
\fB\-r\fR, \fB\-\-retain\fR
When the program terminates, retain routes added by \fBzebra\fR.
Expand Down
4 changes: 4 additions & 0 deletions isisd/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2004-11-25 Hasso Tepper <hasso at quagga.net>

* isis_main.c: Make group to run as configurable.

2004-11-24 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

* dict.c: Include "zassert.h" instead of <assert.h>.
Expand Down
10 changes: 7 additions & 3 deletions isisd/isis_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ struct option longopts[] = {
{"vty_addr", required_argument, NULL, 'A'},
{"vty_port", required_argument, NULL, 'P'},
{"user", required_argument, NULL, 'u'},
{"group", required_argument, NULL, 'g'},
{"version", no_argument, NULL, 'v'},
{"help", no_argument, NULL, 'h'},
{0}
Expand Down Expand Up @@ -121,7 +122,8 @@ Daemon which manages IS-IS routing\n\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\
-u, --user User to run as\n\
-g, --group Group to run as\n\
-v, --version Print program version\n\
-h, --help Display this help and exit\n\
\n\
Expand Down Expand Up @@ -234,7 +236,7 @@ main (int argc, char **argv, char **envp)
/* Command line argument treatment. */
while (1)
{
opt = getopt_long (argc, argv, "df:i:hA:p:P:u:v", longopts, 0);
opt = getopt_long (argc, argv, "df:i:hA:p:P:u:g:v", longopts, 0);

if (opt == EOF)
break;
Expand Down Expand Up @@ -267,8 +269,10 @@ main (int argc, char **argv, char **envp)
vty_port = (vty_port ? vty_port : ISISD_VTY_PORT);
break;
case 'u':
isisd_privs.user = isisd_privs.group = optarg;
isisd_privs.user = optarg;
break;
case 'g':
isisd_privs.group = optarg;
break;
case 'v':
printf ("ISISd version %s\n", ISISD_VERSION);
Expand Down
4 changes: 4 additions & 0 deletions ospf6d/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2004-11-25 Hasso Tepper <hasso at quagga.net>

* ospf6_main.c: Make group to run as configurable.

2004-11-05 Phil Spagnolo <phillip.a.spagnolo@boeing.com>
* ospf6_flood.c: When adding a thread to retransmit an lsa after
rxmt_interval, the ospf6d used thread_add_event(). However,
Expand Down
Loading

0 comments on commit c065230

Please sign in to comment.