From bfece4578db70061084ae984faf2124d818b6c9d Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 19 May 2015 18:03:46 -0700 Subject: [PATCH] Adding following files: MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit /etc ├── quagga │   ├── bgpd.conf │   ├── debian.conf │   ├── ospf6d.conf │   ├── ospfd.conf │   ├── vtysh.conf │   └── zebra.conf └── sudoers.d └── quagga_sudoers --- cumulus/etc/quagga/bgpd.conf | 5 +++++ cumulus/etc/quagga/debian.conf | 17 +++++++++++++++++ cumulus/etc/quagga/ospf6d.conf | 5 +++++ cumulus/etc/quagga/ospfd.conf | 5 +++++ cumulus/etc/quagga/vtysh.conf | 2 ++ cumulus/etc/quagga/zebra.conf | 4 ++++ cumulus/etc/sudoers.d/quagga_sudoers | 1 + debian/quagga.install | 1 + debian/quagga.postinst | 23 +++++++++++++++++++++++ 9 files changed, 63 insertions(+) create mode 100644 cumulus/etc/quagga/bgpd.conf create mode 100644 cumulus/etc/quagga/debian.conf create mode 100644 cumulus/etc/quagga/ospf6d.conf create mode 100644 cumulus/etc/quagga/ospfd.conf create mode 100644 cumulus/etc/quagga/vtysh.conf create mode 100644 cumulus/etc/quagga/zebra.conf create mode 100644 cumulus/etc/sudoers.d/quagga_sudoers diff --git a/cumulus/etc/quagga/bgpd.conf b/cumulus/etc/quagga/bgpd.conf new file mode 100644 index 0000000000..00a4fec0bb --- /dev/null +++ b/cumulus/etc/quagga/bgpd.conf @@ -0,0 +1,5 @@ +hostname bgpd +password cn321 +enable password cn321 +log timestamp precision 6 +log file /var/log/quagga/bgpd.log diff --git a/cumulus/etc/quagga/debian.conf b/cumulus/etc/quagga/debian.conf new file mode 100644 index 0000000000..27ea461af9 --- /dev/null +++ b/cumulus/etc/quagga/debian.conf @@ -0,0 +1,17 @@ +# +# If this option is set the /etc/init.d/quagga script automatically loads +# the config via "vtysh -b" when the servers are started. +# Check /etc/pam.d/quagga if you intend to use "vtysh"! +# +vtysh_enable=yes +zebra_options=" --daemon -A 127.0.0.1" +bgpd_options=" --daemon -A 127.0.0.1" +ospfd_options=" --daemon -A 127.0.0.1" +ospf6d_options=" --daemon -A ::1" +ripd_options=" --daemon -A 127.0.0.1" +ripngd_options=" --daemon -A ::1" +isisd_options=" --daemon -A 127.0.0.1" +babeld_options=" --daemon -A 127.0.0.1" +# The list of daemons to watch is automatically generated by the init script. +watchquagga_enable=yes +watchquagga_options=(-adz -r /usr/sbin/servicebBquaggabBrestartbB%s -s /usr/sbin/servicebBquaggabBstartbB%s -k /usr/sbin/servicebBquaggabBstopbB%s -b bB -t 30) diff --git a/cumulus/etc/quagga/ospf6d.conf b/cumulus/etc/quagga/ospf6d.conf new file mode 100644 index 0000000000..d24df73db9 --- /dev/null +++ b/cumulus/etc/quagga/ospf6d.conf @@ -0,0 +1,5 @@ +hostname ospfd +password cn321 +enable password cn321 +log timestamp precision 6 +log file /var/log/quagga/ospf6d.log diff --git a/cumulus/etc/quagga/ospfd.conf b/cumulus/etc/quagga/ospfd.conf new file mode 100644 index 0000000000..e20ed4a287 --- /dev/null +++ b/cumulus/etc/quagga/ospfd.conf @@ -0,0 +1,5 @@ +hostname ospfd +password cn321 +enable password cn321 +log timestamp precision 6 +log file /var/log/quagga/ospfd.log diff --git a/cumulus/etc/quagga/vtysh.conf b/cumulus/etc/quagga/vtysh.conf new file mode 100644 index 0000000000..80ceb00891 --- /dev/null +++ b/cumulus/etc/quagga/vtysh.conf @@ -0,0 +1,2 @@ +service integrated-vtysh-config +username cumulus nopassword diff --git a/cumulus/etc/quagga/zebra.conf b/cumulus/etc/quagga/zebra.conf new file mode 100644 index 0000000000..827c38a2e4 --- /dev/null +++ b/cumulus/etc/quagga/zebra.conf @@ -0,0 +1,4 @@ +hostname zebra +password cn321 +enable password cn321 +log file /var/log/quagga/zebra.log diff --git a/cumulus/etc/sudoers.d/quagga_sudoers b/cumulus/etc/sudoers.d/quagga_sudoers new file mode 100644 index 0000000000..972966c6a8 --- /dev/null +++ b/cumulus/etc/sudoers.d/quagga_sudoers @@ -0,0 +1 @@ +Defaults env_keep += VTYSH_PAGER diff --git a/debian/quagga.install b/debian/quagga.install index 1a7420dd23..50cea8872c 100644 --- a/debian/quagga.install +++ b/debian/quagga.install @@ -15,3 +15,4 @@ usr/share/man/man8/isisd.8 usr/share/man/man8/quagga-babeld.8 usr/share/man/man8/watchquagga.8 usr/share/snmp/mibs/ +cumulus/etc/* etc/ diff --git a/debian/quagga.postinst b/debian/quagga.postinst index bed2fd3cf7..7b1d000d81 100644 --- a/debian/quagga.postinst +++ b/debian/quagga.postinst @@ -1,5 +1,28 @@ #!/bin/bash -e +###################### +PASSWDFILE=/etc/passwd +GROUPFILE=/etc/group + +quaggauid=`egrep "^quagga:" $PASSWDFILE | awk -F ":" '{ print $3 }'` +quaggagid=`egrep "^quagga:" $GROUPFILE | awk -F ":" '{ print $3 }'` +quaggavtygid=`egrep "^quaggavty:" $GROUPFILE | awk -F ":" '{ print $3 }'` + +[ -n ${quaggauid} ] || (echo "No uid for quagga in ${PASSWDFILE}" && /bin/false) +[ -n ${quaggagid} ] || (echo "No gid for quagga in ${GROUPFILE}" && /bin/false) +[ -n ${quaggaVTYgid} ] || (echo "No gid for quaggavty in ${GROUPFILE}" && /bin/false) + +chown -R ${quaggauid}:${quaggagid} /etc/quagga +chgrp ${quaggavtygid} /etc/quagga/vtysh* +chmod 440 /etc/sudoers.d/quagga_sudoers +chmod 644 /etc/quagga/* + +ENVIRONMENTFILE=/etc/environment +if ! grep --quiet VTYSH_PAGER=/bin/cat ${ENVIRONMENTFILE}; then + echo "VTYSH_PAGER=/bin/cat" >> ${ENVIRONMENTFILE} +fi +################################################## + if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi ${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*"} -- 2.39.5