diff options
Diffstat (limited to 'debian')
-rw-r--r-- | debian/README | 26 | ||||
-rwxr-xr-x | debian/autogen.sh | 37 | ||||
-rw-r--r-- | debian/changelog | 181 | ||||
-rw-r--r-- | debian/compat | 1 | ||||
-rw-r--r-- | debian/control | 39 | ||||
-rw-r--r-- | debian/copyright | 39 | ||||
-rw-r--r-- | debian/docs | 3 | ||||
-rwxr-xr-x | debian/import | 23 | ||||
-rw-r--r-- | debian/lintian | 3 | ||||
-rwxr-xr-x | debian/rules | 144 | ||||
-rw-r--r-- | debian/vyatta-quagga.dirs | 4 | ||||
-rw-r--r-- | debian/vyatta-quagga.files | 14 | ||||
-rw-r--r-- | debian/vyatta-quagga.init.d | 153 | ||||
-rw-r--r-- | debian/vyatta-quagga.logrotate | 17 | ||||
-rw-r--r-- | debian/vyatta-quagga.manpages | 8 | ||||
-rw-r--r-- | debian/vyatta-quagga.pam | 3 | ||||
-rw-r--r-- | debian/vyatta-quagga.postinst | 17 | ||||
-rw-r--r-- | debian/vyatta-quagga.postrm | 19 | ||||
-rw-r--r-- | debian/vyatta-quagga.preinst | 87 |
19 files changed, 818 insertions, 0 deletions
diff --git a/debian/README b/debian/README new file mode 100644 index 00000000..cd10e951 --- /dev/null +++ b/debian/README @@ -0,0 +1,26 @@ +The Debian Package vyatta-quagga +---------------------------- + +This package is the Vyatta build of the Quagga routing protocol +daemons. The source is maintained in the GIT repository: + http://suva.vyatta.com/quagga.git + +The upstream CVS repository is: + :pserver:anoncvs@anoncvs.quagga.net:/var/cvsroot quagga + +To clone the source for this package: + git clone http://suva.vyatta.com/quagga.git + +To build: + git-buildpackage -us -uc + +To build from the source package, first add the following to +/etc/apt/sources.list: + deb-src http://archive1.vyatta.com/vyatta community testing + +Then: + apt-get source vyatta-quagga + cd vyatta-quagga-VERSION + debuild -nc -b -uc -us + + -- Tom Grennan <tgrennan@vyatta.com> Wed, 19 DEC 2007 diff --git a/debian/autogen.sh b/debian/autogen.sh new file mode 100755 index 00000000..ff125d1d --- /dev/null +++ b/debian/autogen.sh @@ -0,0 +1,37 @@ +#!/bin/sh + + +if [ -d .git ] ; then +# generate GNU/Debian format ChangeLog from git log + + rm -f ChangeLog + + if which git2cl >/dev/null ; then + git-log --pretty --numstat --summary | git2cl >> ChangeLog + else + git-log --pretty=short >> ChangeLog + fi + +# append repository reference + + url=` git repo-config --get remote.origin.url` + test "x$url" = "x" && url=`pwd` + + branch=`git-branch --no-color | sed '/^\* /!d; s/^\* //'` + test "x$branch" = "x" && branch=master + + sha=`git log --pretty=oneline --no-color -n 1 | cut -c-8` + test "x$sha" = "x" && sha=00000000 + + echo "$url#$branch-$sha" >> ChangeLog + +fi + +rm -rf config +rm -f aclocal.m4 config.guess config.statusconfig.sub configure INSTALL + +autoreconf --force --install + +rm -f config.sub config.guess +ln -s /usr/share/misc/config.sub . +ln -s /usr/share/misc/config.guess . diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000..a0dffeab --- /dev/null +++ b/debian/changelog @@ -0,0 +1,181 @@ +vyatta-quagga (0.99.9-4) unstable; urgency=low + + 3.0.2 + [ Mark O'Brien ] + + * 3.0.1 + + [ Michael Larson ] + * bumped up netlink recv buffer limits for zebra--should alleviate + netlink error msgs that occur under large routing tables when layer + * support 64bit + * added interface/address exclusion support to watchlink. The correct + format is: + * modified watchlink parser to support the following behaviors: + * add wildcard for interfaces. use an "*" in place of an interface + name--and the address provided will exclude all + + [ Stephen Hemminger ] + * Filter unwanted netlink messages + * fix build on on 64 bit platforms + * add locking to prevent file update problems + + [ rbalocca ] + * Remove unused lintian "ignore" option + + [ Mark O'Brien ] + + -- Mark O'Brien <mobrien@vyatta.com> Fri, 04 Apr 2008 18:01:16 -0700 + +vyatta-quagga (0.99.9-3) unstable; urgency=low + + VC4.0.1 + [ Mark O'Brien ] + + + [ Bob Gilligan ] + * Bugfix: 2845 + + [ Michael Larson ] + * revert behavior for watchlink to pulling/pushing address on + interface on IFF_RUNNING|IFF_UP event. + * And with the correct licensing headers. + + [ Mohit Mehta ] + * Fix Bug 2750 bgp: large ASN shown as negative + * Fix Bug 2750 bgp: large ASN shown as negative + + [ Stephen Hemminger ] + * Change license notice from VPL to GPLv2 + + [ Stig Thormodsrud ] + * Fix 2842: Protocol debug does not take affect until underlying log + level + + [ Mark O'Brien ] + + -- Mark O'Brien <mobrien@vyatta.com> Tue, 18 Mar 2008 19:05:11 -0700 + +vyatta-quagga (0.99.9-2) unstable; urgency=low + + vc4.0.0 + [ Mark O'Brien ] + + + [ An-Cheng Huang ] + * remove generated files from repo + + [ Justin Fletcher ] + * Log to syslog daemon + + [ Michael Larson ] + * fix for static interface and static nexthop routes for quagga. Now + respects cable pull (IFF_RUNNING) events and admin (IFF_UP) events. + * initial check-in of watchlink project. compiles, runs and manages + state. needs additional testing and updates + * removed unnecessary files. + * packaging and make rules for base vyatta-quagga project to build + watchlink + * Added quagga like features to watchlink pgm: standard pid file + creation and background option. Also + * hooks to start/stop watchlink daemon with quagga + * create directory for watchlink to store link status + * moved creation of linkstatus directory from postinst to preinst + where it should be. + * cleaned up source a bit. added syslog error messages. added legal- + eeze. + * added support for filtering of interfaces. filter or exclusion list + needs to be be written to exclude + * removed stderr message when unable to open exclusion file. Also + downgraded syslog entry to + * added empty exclude file creation to make watchlink happy + * fix bug introduced with ptp support--indexing of database and + initialization of terminating address. + * fix for bc addr and fix for parsing iface for show cmds and filter + * need to qualify test for non-ethernet type interfaces to + newlink/dellink messages only. + * moved some stderr messages to syslog. removed stderr message when + receiving ack from kernel on netlink msg. + * modified watchlink to manage connected routes in local and main + tables per interface rather than pulling interface address on cable + pull event. + * force so_recvbuf size to 223232 (double of 111616) for netlink in + zebra. will also need to modify + * fix for bug 2750. will also submit to quagga dvlprs. + + [ Stephen Hemminger ] + * avoid package conflict between iproute and vyatta-iproute + * Revert "avoid package conflict between iproute and vyatta-iproute" + + [ Tom Grennan ] + * ignore autoreconf generated files + * ignore emacs backups + * add script to import updates from anoncvs.quagga.net + * import into the "upstream" branch + * initial vyatta-quagga debian config + * finish vyatta debian config + * use default daemon config files rather than /dev/null + * fix log files path + * set default logging + * ignore debuild generated debian/vyatta-quagga.substvars + * donot modify existing conffiles + * separate init of vtysh.conf from other daemons + * use "log syslog LEVEL" not "log file syslog LEVEL" + * ignore watchlink binary + * donot add user "vyatta" to vtysh.conf in preinit, this is now done + during system config + + [ paul ] + * [bgpd] Fix typo, which prevented advertisement of MP (non-IPv4) + prefixes + * [privs/Solaris] Quagga should work in zones with IP instances + * [bgpd] Merge AS4 support + * [tests] Forgot to commit ecommunity_tests.c + * [news] Fix top-line version + * [snmp-smux] Fix problems if 'smux peer ...' is issued multiple times + * [ospf6d] Fix removal of defunct ASBR routes + * 2007-10-30 Nick Hilliard <nick@inex.ie> + * [bgpd] small fix for crash if 'listenon' argument is not given + * [bgpd] Fix typo in previous commit to bgp_main.c + + [ pilot ] + * * rt_socket.c: (kernel_rtm_ipv4) prefix_buf could be passed + * Switch from LOOKUP() to lookup() for rtm_type (see bug #401 for + details). + * + fixed bug #402: now the second zebra process doesn't destroy + routes + * + sayonara old_pid! + * + fix minor regression in OSPF sending buffer adjustment logic + * + fix missing arg to zlog_warn() + * + Minor bugfix: IPv6 prefixes were logged incorrectly in RIB + debugging calls. Fixed. + * + rib_process() speedup for multi-nexthop route nodes + * + pidfiles are now always created with 0644 perms instead if + LOGFILE_MASK (0600) + * + fix the bug reported by Milan Kocian (IPv6 route handling was + broken by the RIB debug changeset). + * + fixed bug #418 (changing address on an existing interface doesn't + cause existing static routes to be revalidated) + * + fixed no_set_aspath_prepend() to correctly match existing "set" + statement + + [ root ] + * added support for ifa_address field in rtm_newaddr message and in + links where the ifa_address != ifa_local then ifa_address is + populated in setaddr message. fix for bug 2650 + * fix for bug 2648--downgraded some syslog messages and removed some + from console. + * fix for bug 2570. increased buffer length from 4096 to 8192 + * fix for ppp--restrict watchlink to ethernet interface types only. + Filter by checking the ifi_type flag in ifinfomsg hdr from netlink. + + [ Mark O'Brien ] + + -- Mark O'Brien <mobrien@vyatta.com> Mon, 25 Feb 2008 17:39:54 -0800 + +vyatta-quagga (0.99.9-1) unstable; urgency=low + + * based on upstream/0.99.9 == d68aac0fbecabfb765a42b3c6e5693836dafda99 + + -- Tom Grennan <tgrennan@vyatta.com> Fri, 21 Dec 2007 19:29:50 +0000 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 00000000..7ed6ff82 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..bfd9db1e --- /dev/null +++ b/debian/control @@ -0,0 +1,39 @@ +Source: vyatta-quagga +Section: contrib/net +Priority: extra +Maintainer: Tom Grennan <tgrennan@vyatta.com> +Build-Depends: debhelper (>= 5), + autotools-dev, + libncurses5-dev, + libreadline5-dev | libreadline-dev, + texinfo (>= 4.7), + libpam0g-dev | libpam-dev, + libcap1 | libcap-dev, + imagemagick, + ghostscript | gs-gpl, + groff, + po-debconf +Standards-Version: 3.7.2 +Vcs-Git: http://suva.vyatta.git/quagga.git + +Package: vyatta-quagga +Architecture: any +Depends: ${shlibs:Depends}, logrotate (>= 3.2-11), iproute, ${misc:Depends} +Pre-Depends: adduser +Conflicts: zebra, zebra-pj +Replaces: zebra, zebra-pj +Suggests: snmpd +Description: BGP/OSPF/RIP routing daemon + GNU Quagga is free software which manages TCP/IP based routing protocols. + It supports BGP4, BGP4+, OSPFv2, OSPFv3, IS-IS, RIPv1, RIPv2, and RIPng as + well as the IPv6 versions of these. + . + As the precessor Zebra has been considered orphaned, the Quagga project + has been formed by members of the zebra mailing list and the former + zebra-pj project to continue developing. + . + Quagga uses threading if the kernel supports it, but can also run on + kernels that do not support threading. Each protocol has its own daemon. + . + It is more than a routed replacement, it can be used as a Route Server and + a Route Reflector. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000..78f470e7 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,39 @@ +This package and repository was debianized for the git-buildpackage +tool by Tom Grennan <tgrennan@vyatta.com> on Dec 19, 2007. This was +derived from the debian package by Christian Hammers <ch@debian.org> +on 2003-07-01. + +The source is maintained in the GIT repository: + http://suva.vyatta.com/quagga.git + +The upstream CVS repository is: + :pserver:anoncvs@anoncvs.quagga.net:/var/cvsroot quagga + +Upstream Authors: + + Authors of the original Zebra are + Kunihiro Ishiguro <kunihiro@zebra.org> + Toshiaki Takada <takada@zebra.org> + Yasuhiro Ohara <yasu@sfc.wide.ad.jp> + + Main patch collector for quagga is + Paul Jakma <paul@jakma.org> + +Copyright: + + Copyright (c) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro <kunihiro@zebra.org> + Portions Copyright (c) 2003 Paul Jakma <paul@dishone.st> + +License: + + The package libraries are subject to Library General Public License, + version 2. The remainder package contents are subject to GNU General + Pulic License, version 2. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + +On Debian systems, the complete text of these licenses can be found in +`/usr/share/common-licenses/{GPL-2,LGPL-2}'. diff --git a/debian/docs b/debian/docs new file mode 100644 index 00000000..6f83607c --- /dev/null +++ b/debian/docs @@ -0,0 +1,3 @@ +AUTHORS +NEWS +README diff --git a/debian/import b/debian/import new file mode 100755 index 00000000..ac03e249 --- /dev/null +++ b/debian/import @@ -0,0 +1,23 @@ +#!/bin/bash + +# Import updates from main CVS repo + +if ! git branch -l | grep -q upstream ; then + git branch upstream origin/upstream +fi + +# verbose args: -v -p-v +git-cvsimport -d :pserver:anoncvs@anoncvs.quagga.net:/var/cvsroot -k -u -i -m -o upstream quagga + +# Annotate tags + +git tag -l | +while read t ; do + if [ ! -r .git/refs/tags/$t ] ; then + r=$(git-show-ref -s $t) + git tag -d $t + git tag -a -m 'import cvs tag' $t $r + fi +done + +echo "Remember to: git push suva:/git/quagga.git upstream" diff --git a/debian/lintian b/debian/lintian new file mode 100644 index 00000000..8368204a --- /dev/null +++ b/debian/lintian @@ -0,0 +1,3 @@ +vyatta-quagga: binary-without-manpage usr/sbin/vyatta-ospfclient +vyatta-quagga: binary-without-manpage usr/sbin/vyatta-watchquagga +vyatta-quagga: binary-without-manpage usr/sbin/vyatta-watchlink diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000..7681bcb3 --- /dev/null +++ b/debian/rules @@ -0,0 +1,144 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +PACKAGE=vyatta-quagga +PKGDIR=$(CURDIR)/debian/$(PACKAGE) +BUILD_STAMP=debian/build-stamp +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +ifeq ($(WANT_SNMP),1) + xable_snmp = --enable-snmp +else + xable_snmp = --disable-snmp +endif + +configure = ./configure +configure += --host=$(DEB_HOST_GNU_TYPE) +configure += --build=$(DEB_BUILD_GNU_TYPE) +configure += --prefix=/usr +configure += --program-prefix=vyatta- +configure += --libdir=/usr/lib/$(PACKAGE) +configure += --localstatedir=/var/run/vyatta/quagga +configure += --sysconfdir=/etc/vyatta/quagga +configure += --mandir=/usr/share/man +configure += --includedir=/usr/include/vyatta +configure += --infodir=/usr/share/info/$(PACKAGE) +configure += --enable-exampledir=/usr/share/doc/$(PACKAGE)/examples +configure += --enable-vtysh +configure += --enable-ipv6 +configure += --enable-isisd +configure += --enable-watchquagga +configure += --enable-watchlink +configure += --enable-opaque-lsa +configure += --enable-ospfclient=yes +configure += --enable-ospfapi=yes +configure += --enable-ospf-te +configure += --enable-multipath=64 +configure += --enable-user=quagga +configure += --enable-group=quagga +configure += --enable-vty-group=quaggavty +configure += --enable-configfile-mask=0640 +configure += --enable-logfile-mask=0640 +configure += --enable-rtadv +configure += --enable-tcp-md5 +configure += --enable-gcc-rdynamic +configure += $(xable_snmp) +configure += --with-libpam +configure += CFLAGS="$(CFLAGS)" +# configure += LDFLAGS="-Wl,-z,defs" + +configure: configure.ac Makefile.am + chmod +x debian/autogen.sh + debian/autogen.sh + +config.status: configure + dh_testdir + rm -f config.cache + $(configure) + +build: $(BUILD_STAMP) + +$(BUILD_STAMP): config.status + dh_testdir + $(MAKE) + touch $@ + +clean: clean-patched + +# Clean everything up, including everything auto-generated +# at build time that needs not to be kept around in the Debian diff +clean-patched: + dh_testdir + dh_testroot + if test -f Makefile ; then $(MAKE) clean distclean ; fi + rm -f $(BUILD_STAMP) + rm -f config.status config.sub config.guess config.log + rm -f aclocal.m4 configure Makefile.in Makefile INSTALL + rm -f etc/default/vyatta + rm -rf config + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + $(MAKE) DESTDIR=$(PKGDIR) install + + install -D --mode=0644 debian/lintian $(PKGDIR)/usr/share/lintian/overrides/$(PACKAGE) + +ifeq ($(WANT_SNMP), 1) + install -D --mode=0644 zebra/GNOME-PRODUCT-ZEBRA-MIB $(PKGDIR)/usr/share/snmp/mibs +endif + + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + + dh_installdirs + dh_link + + dh_installchangelogs ChangeLog + dh_installdebconf + dh_installdocs + dh_installexamples + dh_installinit + dh_installpam + dh_installlogrotate + + dh_strip + dh_compress + dh_fixperms + dh_makeshlibs --noscripts + dh_installdeb +# dh_shlibdeps: removed "-L quagga" for Woody backport compatibility. + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-arch +.PHONY: build clean binary-arch binary install + diff --git a/debian/vyatta-quagga.dirs b/debian/vyatta-quagga.dirs new file mode 100644 index 00000000..8f5c59a8 --- /dev/null +++ b/debian/vyatta-quagga.dirs @@ -0,0 +1,4 @@ +etc/logrotate.d/ +etc/vyatta/ +var/log/vyatta/ +var/run/vyatta/ diff --git a/debian/vyatta-quagga.files b/debian/vyatta-quagga.files new file mode 100644 index 00000000..38b1ab33 --- /dev/null +++ b/debian/vyatta-quagga.files @@ -0,0 +1,14 @@ +etc/quagga/ +opt/vyatta/ +usr/lib/vyatta-quagga/ +usr/share/lintian/overrides/ +usr/share/man/man1/vtysh.1 +usr/share/man/man8 +usr/share/man/man8/bgpd.8 +usr/share/man/man8/ospf6d.8 +usr/share/man/man8/ospfd.8 +usr/share/man/man8/ripd.8 +usr/share/man/man8/ripngd.8 +usr/share/man/man8/zebra.8 +usr/share/man/man8/isisd.8 +usr/share/snmp/mibs/ diff --git a/debian/vyatta-quagga.init.d b/debian/vyatta-quagga.init.d new file mode 100644 index 00000000..0bf2eaab --- /dev/null +++ b/debian/vyatta-quagga.init.d @@ -0,0 +1,153 @@ +#!/bin/bash +# +### BEGIN INIT INFO +# Provides: vyatta-quagga +# Required-Start: $local_fs $network $remote_fs $syslog +# Required-Stop: $local_fs $network $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: start and stop the Quagga routing suite +# Description: Quagga is a routing suite for IP routing protocols like +# BGP, OSPF, RIP and others. This script contols the main +# daemon "quagga" as well as the individual protocol daemons. +# FIXME! this init script will be deprecated as daemon start/stop +# is integrated with vyatta-cfg-quagga +### END INIT INFO +# + +. /lib/lsb/init-functions + +declare progname=${0##*/} +declare action=$1; shift + +pid_dir=/var/run/vyatta/quagga +log_dir=/var/log/vyatta/quagga + +for dir in $pid_dir $log_dir ; do + if [ ! -d $dir ]; then + mkdir -p $dir + chown quagga:quagga $dir + chmod 755 $dir + fi +done + +declare -a common_args=( -d -P 0 ) +declare -a watchlink_args=( -s -d -i $pid_dir/watchlink.pid ) +declare -a zebra_args=( ${common_args[@]} -l -s 1048576 -i $pid_dir/zebra.pid ) +declare -a ripd_args=( ${common_args[@]} -i $pid_dir/ripd.pid ) +declare -a ripngd_args=( ${common_args[@]} -i $pid_dir/ripngd.pid ) +declare -a ospfd_args=( ${common_args[@]} -i $pid_dir/ospfd.pid ) +declare -a ospf6d_args=( ${common_args[@]} -i $pid_dir/ospf6d.pid ) +declare -a isisd_args=( ${common_args[@]} -i $pid_dir/isisd.pid ) +declare -a bgpd_args=( ${common_args[@]} -i $pid_dir/bgpd.pid ) + +vyatta_quagga_start () +{ + local -a daemons + if [ $# -gt 0 ] ; then + daemons=( $* ) + else + daemons+=( watchlink ) + daemons+=( zebra ) + daemons+=( ripd ) +# daemons+=( ripngd ) + daemons+=( ospfd ) +# daemons+=( ospf6d ) +# daemons+=( isisd ) + daemons+=( bgpd ) + fi + + log_action_begin_msg "Starting Quagga" + for daemon in ${daemons[@]} ; do + [ "$daemon" != zebra ] && \ + log_action_cont_msg "$daemon" + start-stop-daemon \ + --start \ + --quiet \ + --oknodo \ + --pidfile=$pid_dir/${daemon}.pid \ + --chdir $log_dir \ + --exec "/usr/sbin/vyatta-${daemon}" \ + -- `eval echo "$""{${daemon}_args[@]}"` || \ + ( log_action_end_msg 1 ; return 1 ) + done + log_action_end_msg 0 +} + +vyatta_quagga_stop () +{ + local -a daemons + + if [ $# -gt 0 ] ; then + daemons=( $* ) + else + daemons=( watchlink bgpd isisd ospf6d ospfd ripngd ripd zebra ) + fi + log_action_begin_msg "Stopping Quagga" + for daemon in ${daemons[@]} ; do + pidfile=$pid_dir/${daemon}.pid + if [ -r $pidfile ] ; then + pid=`cat $pidfile 2>/dev/null` + else + pid=`ps -o pid= -C vyatta-${daemon}` + fi + if [ -n "$pid" ] ; then + [ "$daemon" != zebra ] && \ + log_action_cont_msg "$daemon" + start-stop-daemon \ + --stop \ + --quiet \ + --oknodo \ + --exec /usr/sbin/vyatta-${daemon} +# +# Now we have to wait until $DAEMON has _really_ stopped. +# + for (( tries=0; tries<30; tries++ )) ; do + if [[ -d /proc/$pid ]] ; then + sleep 3 + kill -0 $pid 2>/dev/null + else + break + fi + done + rm -f $pidfile + fi + done + log_action_end_msg $? + if echo ${daemons[@]} | grep -q zebra ; then + log_begin_msg "Removing all Quagga Routes" + ip route flush proto zebra + log_end_msg $? + fi +} + +case "$action" in + start) + # Try to load this necessary (at least for 2.6) module. + if [ -d /lib/modules/`uname -r` ] ; then + log_begin_msg "Loading capability module if not yet done" + set +e; \ + LC_ALL=C \ + modprobe -a capability 2>&1 | \ + egrep -v "(not found|Can't locate)"; \ + set -e + log_end_msg 0 + fi + vyatta_quagga_start $* + ;; + + stop|0) + vyatta_quagga_stop $* + ;; + + restart|force-reload) + vyatta_quagga_stop $* + sleep 2 + vyatta_quagga_start $* + ;; + + *) + echo "Usage: $progname {start|stop|restart|force-reload} [daemon...]" + exit 1 + ;; +esac diff --git a/debian/vyatta-quagga.logrotate b/debian/vyatta-quagga.logrotate new file mode 100644 index 00000000..020eb83e --- /dev/null +++ b/debian/vyatta-quagga.logrotate @@ -0,0 +1,17 @@ +/var/log/vyatta/quagga/*.log { + daily + rotate 5 + sharedscripts + missingok + compress + create 640 quagga quaggavty + + postrotate + for daemon in zebra bgpd ripd ospfd ripngd ospf6d isisd; do + if [ -e /var/run/vyatta/quagga/$daemon.pid ] ; then + kill -USR1 `cat /var/run/vyatta/quagga/$daemon.pid` + fi + + done + endscript +} diff --git a/debian/vyatta-quagga.manpages b/debian/vyatta-quagga.manpages new file mode 100644 index 00000000..24556b2d --- /dev/null +++ b/debian/vyatta-quagga.manpages @@ -0,0 +1,8 @@ +doc/bgpd.8 +doc/ospf6d.8 +doc/ospfd.8 +doc/ripd.8 +doc/ripngd.8 +doc/vtysh.1 +doc/zebra.8 +doc/isisd.8 diff --git a/debian/vyatta-quagga.pam b/debian/vyatta-quagga.pam new file mode 100644 index 00000000..093e1729 --- /dev/null +++ b/debian/vyatta-quagga.pam @@ -0,0 +1,3 @@ +# Any user may call vtysh but only those belonging to the group quaggavty can +# actually connect to the socket and use the program. +auth sufficient pam_permit.so diff --git a/debian/vyatta-quagga.postinst b/debian/vyatta-quagga.postinst new file mode 100644 index 00000000..bed2fd3c --- /dev/null +++ b/debian/vyatta-quagga.postinst @@ -0,0 +1,17 @@ +#!/bin/bash -e + +if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi +${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*"} + +# This is most likely due to the answer "no" to the "really stop the server" +# question in the prerm script. +if [ "$1" = "abort-upgrade" ]; then + exit 0 +fi + +. /usr/share/debconf/confmodule + +db_stop + +#DEBHELPER# + diff --git a/debian/vyatta-quagga.postrm b/debian/vyatta-quagga.postrm new file mode 100644 index 00000000..dac97986 --- /dev/null +++ b/debian/vyatta-quagga.postrm @@ -0,0 +1,19 @@ +#!/bin/bash + +if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi +${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*"} +# set -e not because of userdel +# set -u not because of debhelper + +if [ "$1" = "purge" ]; then + for daemon in zebra bgpd ripd ospfd ripngd ospf6d isisd; do + rm -f /var/run/vyatta/${daemon}.pid + rm -f /var/log/vyatta/${daemon}* + done + [ -z "`ls /var/run/vyatta 2>/dev/null`" ] && rmdir /var/run/vyatta + [ -z "`ls /var/log/vyatta 2>/dev/null`" ] && rmdir /var/log/vyatta + rm -f /etc/vyatta/Quagga.conf /etc/vyatta/vtysh.conf + userdel quagga >/dev/null 2>&1 +fi + +#DEBHELPER# diff --git a/debian/vyatta-quagga.preinst b/debian/vyatta-quagga.preinst new file mode 100644 index 00000000..4222ef3b --- /dev/null +++ b/debian/vyatta-quagga.preinst @@ -0,0 +1,87 @@ +#!/bin/bash + +if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi +${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*"} +set -e +set -u + +LOG_DIR=/var/log/vyatta/quagga +LOG_PDIR=${LOG_DIR%/*} +RUN_DIR=/var/run/vyatta/quagga +RUN_PDIR=${RUN_DIR%/*} +ETC_DIR=/etc/vyatta/quagga +ETC_PDIR=${ETC_DIR%/*} +WATCHLINK_DIR=/var/linkstatus + +# creating quaggavty group if it isn't already there +if ! getent group quaggavty >/dev/null; then + addgroup --system quaggavty >/dev/null +fi + +# creating quagga group if it isn't already there +if ! getent group quagga >/dev/null; then + addgroup --system quagga >/dev/null +fi + +# creating quagga user if he isn't already there +if ! getent passwd quagga >/dev/null; then + adduser \ + --system \ + --ingroup quagga \ + --home /var/run/vyatta/ \ + --gecos "Vyatta Quagga routing suite" \ + --shell /bin/false \ + quagga >/dev/null +fi + +# Do not change permissions when upgrading as it would violate policy. +if [ "$1" = "install" ]; then + # Install linkstatus directory + mkdir -p $WATCHLINK_DIR + touch $WATCHLINK_DIR/exclude + + # Logfiles are group readable in case users were put into the quagga group. + mkdir -p $LOG_PDIR + chmod 0755 $LOG_PDIR + mkdir -p $LOG_DIR + chmod 0775 $LOG_DIR + chown quagga:quagga $LOG_DIR + + # Strict permissions for the sockets. + mkdir -p $RUN_PDIR + chmod 0755 $RUN_PDIR + mkdir -p $RUN_DIR + chmod 0755 $RUN_DIR + chown quagga:quagga $RUN_DIR + + # create empty config files + mkdir -p $ETC_PDIR + chmod 0755 $ETC_PDIR + mkdir -p $ETC_DIR + chmod 0775 $ETC_DIR + chown quagga:quaggavty $ETC_DIR + for daemon in zebra ripd ripngd ospfd ospf6d isisd bgpd ; do + if [ ! -e $ETC_DIR/${daemon}.conf ] ; then + touch $ETC_DIR/${daemon}.conf + chown quagga:quaggavty $ETC_DIR/${daemon}.conf + chmod 0640 $ETC_DIR/${daemon}.conf + cat <<-EOF > $ETC_DIR/${daemon}.conf + log syslog + log facility local7 + EOF + fi + done + if [ ! -e $ETC_DIR/vtysh.conf ] ; then + touch $ETC_DIR/vtysh.conf + chown quagga:quaggavty $ETC_DIR/vtysh.conf + chmod 0640 $ETC_DIR/vtysh.conf + cat <<-EOF >> $ETC_DIR/vtysh.conf + username root nopassword + EOF + fi + + # Disable debian/ubuntu package init + update-rc.d -f quagga remove +fi + +#DEBHELPER# |