changeset 7:3c0db610c641

add bgpd config file and proper logrotate config
author Carl Byington <carl@five-ten-sg.com>
date Thu, 04 Sep 2014 08:53:18 -0700
parents 5e7c39aa868c
children 69a5dcf953df
files Makefile.am bgpd.conf routeflapper.logrotate routeflapper.spec.in
diffstat 4 files changed, 41 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.am	Wed Sep 03 17:29:04 2014 -0700
+++ b/Makefile.am	Thu Sep 04 08:53:18 2014 -0700
@@ -3,11 +3,11 @@
 SUBDIRS = src man html info
 hackdir = $(sysconfdir)
 hack_SCRIPTS = routeflapper
-sysconf_DATA = routeflapper.conf
+sysconf_DATA = routeflapper.conf routeflapper.logrotate bgpd.conf
 htmldir = ${datadir}/doc/@PACKAGE@-@VERSION@
 html_DATA = AUTHORS COPYING ChangeLog NEWS README
 CLEANFILES = routeflapper xml/routeflapper xml/Makefile
-EXTRA_DIST = routeflapper.conf routeflapper.spec $(wildcard xml/h*) $(wildcard xml/M*) $(wildcard xml/r*)
+EXTRA_DIST = routeflapper.logrotate bgpd.conf routeflapper.conf routeflapper.spec $(wildcard xml/h*) $(wildcard xml/M*) $(wildcard xml/r*)
 
 routeflapper: routeflapper.rc
 	   cat routeflapper.rc     | \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bgpd.conf	Thu Sep 04 08:53:18 2014 -0700
@@ -0,0 +1,16 @@
+hostname $HOST
+log file /var/log/bgp
+!
+debug bgp updates
+!
+password $PASS
+enable password $PASS
+!
+router bgp 65500
+ bgp router-id $LOCALIP
+ bgp log-neighbor-changes
+ neighbor $REMOTEIP remote-as $ASN
+!
+line vty
+!
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/routeflapper.logrotate	Thu Sep 04 08:53:18 2014 -0700
@@ -0,0 +1,8 @@
+/var/log/bgp {
+    daily
+    notifempty
+    missingok
+    postrotate
+	/bin/kill -USR1 `cat /var/run/quagga/bgpd.pid 2> /dev/null` 2> /dev/null || true
+    endscript
+}
--- a/routeflapper.spec.in	Wed Sep 03 17:29:04 2014 -0700
+++ b/routeflapper.spec.in	Thu Sep 04 08:53:18 2014 -0700
@@ -3,7 +3,7 @@
 Summary:            Route flap detector
 Name:               @PACKAGE@
 Version:            @VERSION@
-Release:            1%{?dist}
+Release:            2%{?dist}
 License:            GPLv3+
 Group:              System Environment/Daemons
 Source:             http://www.five-ten-sg.com/%{name}/packages/%{name}-%{version}.tar.gz
@@ -36,7 +36,11 @@
 rm -rf $RPM_BUILD_ROOT
 make DESTDIR=$RPM_BUILD_ROOT install
 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
+mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/quagga
 mv -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name} $RPM_BUILD_ROOT/etc/rc.d/init.d
+mv -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/routeflapper
+mv -f $RPM_BUILD_ROOT%{_sysconfdir}/bgpd.conf         $RPM_BUILD_ROOT%{_sysconfdir}/quagga
 mkdir -p $RPM_BUILD_ROOT/var/run/%{name}
 
 
@@ -49,14 +53,16 @@
 
 %post
 /sbin/chkconfig --add %{name}
+touch /var/log/bgp
+chown quagga:quagga /var/log/bgp
 
 
 %preun
 [ $1 = 0 ] && /sbin/service %{name} stop || :
+[ $1 = 0 ] && /sbin/chkconfig --del %{name}
 
 
 %postun
-[ $1 = 0 ] && /sbin/chkconfig --del %{name}
 
 
 %files
@@ -67,11 +73,17 @@
 %docdir %{_datadir}/doc/%{name}-%{version}
 %{_datadir}/doc/%{name}-%{version}
 %config(noreplace) %{_sysconfdir}/%{name}.conf
+%config(noreplace) %{_sysconfdir}/quagga/bgpd.conf
 /etc/rc.d/init.d/%{name}
+/etc/logrotate.d/%{name}
 %dir %attr(0750,%{name},root) /var/run/%{name}
 
 
 %changelog
+* Thu Sep 04 2014 Carl Byington <carl@five-ten-sg.com> - 1.0.1-2
+- add bgpd.conf and logrotate files
+- fix uninstall, chkconfig del in preun, not postun
+
 * Thu Jun 12 2008 Carl Byington <carl@five-ten-sg.com> - 1.0.1-1
 - initial version