summaryrefslogtreecommitdiffstats
path: root/redhat
diff options
context:
space:
mode:
Diffstat (limited to 'redhat')
-rw-r--r--redhat/bgpd.init60
-rw-r--r--redhat/ospf6d.init60
-rw-r--r--redhat/ospfd.init61
-rw-r--r--redhat/ripd.init60
-rw-r--r--redhat/ripngd.init60
-rw-r--r--redhat/zebra.init61
-rw-r--r--redhat/zebra.logrotate59
-rw-r--r--redhat/zebra.pam18
-rw-r--r--redhat/zebra.spec.in51
9 files changed, 433 insertions, 57 deletions
diff --git a/redhat/bgpd.init b/redhat/bgpd.init
new file mode 100644
index 00000000..d7c2e3fe
--- /dev/null
+++ b/redhat/bgpd.init
@@ -0,0 +1,60 @@
+#!/bin/bash
+#
+# chkconfig: - 16 84
+# description: A BGPv4, BGPv4+, BGPv4- routing engine for use with Zebra
+#
+# processname: bgpd
+# config: /etc/zebra/bgpd.conf
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+[ "${NETWORKING}" = "no" ] && exit 0
+
+# The process must be configured first.
+[ -f /etc/zebra/bgpd.conf ] || exit 0
+
+RETVAL=0
+prog="bgpd"
+
+case "$1" in
+ start)
+ echo -n $"Starting $prog: "
+ daemon /usr/sbin/bgpd -d
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bgpd
+ echo
+ ;;
+ stop)
+ echo -n $"Shutting down $prog: "
+ killproc bgpd
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bgpd
+ echo
+ ;;
+ restart|reload)
+ $0 stop
+ $0 start
+ RETVAL=$?
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/bgpd ]; then
+ $0 stop
+ $0 start
+ fi
+ RETVAL=$?
+ ;;
+ status)
+ status bgpd
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
+ exit 1
+esac
+
+exit $RETVAL
diff --git a/redhat/ospf6d.init b/redhat/ospf6d.init
new file mode 100644
index 00000000..9a6e8c51
--- /dev/null
+++ b/redhat/ospf6d.init
@@ -0,0 +1,60 @@
+#!/bin/bash
+#
+# chkconfig: - 16 84
+# description: An OSPF routing engine for use with Zebra and IPv6
+#
+# processname: ospf6d
+# config: /etc/zebra/ospf6d.conf
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+[ "${NETWORKING_IPV6}" = "no" ] && exit 0
+
+# The process must be configured first.
+[ -f /etc/zebra/ospf6d.conf ] || exit 0
+
+RETVAL=0
+prog="ospf6d"
+
+case "$1" in
+ start)
+ echo -n $"Starting $prog: "
+ daemon /usr/sbin/ospf6d -d
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ospf6d
+ echo
+ ;;
+ stop)
+ echo -n $"Shutting down $prog: "
+ killproc ospf6d
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ospf6d
+ echo
+ ;;
+ restart|reload)
+ $0 stop
+ $0 start
+ RETVAL=$?
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/ospf6d ]; then
+ $0 stop
+ $0 start
+ fi
+ RETVAL=$?
+ ;;
+ status)
+ status ospf6d
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $prog {start|stop|restart|reload|condrestart|status}"
+ exit 1
+esac
+
+exit $RETVAL
diff --git a/redhat/ospfd.init b/redhat/ospfd.init
new file mode 100644
index 00000000..4aab1388
--- /dev/null
+++ b/redhat/ospfd.init
@@ -0,0 +1,61 @@
+#!/bin/bash
+#
+# chkconfig: - 16 84
+# description: An OSPF v2 routing engine for use with Zebra
+#
+# processname: ospfd
+# config: /etc/zebra/ospfd.conf
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+[ "${NETWORKING}" = "no" ] && exit 0
+
+# The process must be configured first.
+[ -f /etc/zebra/ospfd.conf ] || exit 0
+
+RETVAL=0
+
+prog="ospfd"
+
+case "$1" in
+ start)
+ echo -n $"Starting $prog: "
+ daemon /usr/sbin/ospfd -d
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ospfd
+ echo
+ ;;
+ stop)
+ echo -n $"Shutting down $prog: "
+ killproc ospfd
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ospfd
+ echo
+ ;;
+ restart|reload)
+ $0 stop
+ $0 start
+ RETVAL=$?
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/ospfd ]; then
+ $0 stop
+ $0 start
+ fi
+ RETVAL=$?
+ ;;
+ status)
+ status ospfd
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
+ exit 1
+esac
+
+exit $RETVAL
diff --git a/redhat/ripd.init b/redhat/ripd.init
new file mode 100644
index 00000000..2ac67337
--- /dev/null
+++ b/redhat/ripd.init
@@ -0,0 +1,60 @@
+#!/bin/bash
+#
+# chkconfig: - 16 84
+# description: A RIP routing engine for use with Zebra
+#
+# processname: ripd
+# config: /etc/zebra/ripd.conf
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+[ "${NETWORKING}" = "no" ] && exit 0
+
+# The process must be configured first.
+[ -f /etc/zebra/ripd.conf ] || exit 0
+
+RETVAL=0
+prog="ripd"
+
+case "$1" in
+ start)
+ echo -n $"Starting $prog: "
+ daemon /usr/sbin/ripd -d
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ripd
+ echo
+ ;;
+ stop)
+ echo -n $"Shutting down $prog: "
+ killproc ripd
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ripd
+ echo
+ ;;
+ restart|reload)
+ $0 stop
+ $0 start
+ RETVAL=$?
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/ripd ]; then
+ $0 stop
+ $0 start
+ fi
+ RETVAL=$?
+ ;;
+ status)
+ status ripd
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
+ exit 1
+esac
+
+exit $RETVAL
diff --git a/redhat/ripngd.init b/redhat/ripngd.init
new file mode 100644
index 00000000..be54a013
--- /dev/null
+++ b/redhat/ripngd.init
@@ -0,0 +1,60 @@
+#!/bin/bash
+#
+# chkconfig: - 16 84
+# description: A RIP routing engine for use with Zebra and IPv6
+#
+# processname: ripngd
+# config: /etc/zebra/ripngd.conf
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+[ "${NETWORKING_IPV6}" = "no" ] && exit 0
+
+# The process must be configured first.
+[ -f /etc/zebra/ripngd.conf ] || exit 0
+
+RETVAL=0
+prog="ripngd"
+
+case "$1" in
+ start)
+ echo -n $"Starting $prog: "
+ daemon /usr/sbin/ripngd -d
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ripngd
+ echo
+ ;;
+ stop)
+ echo -n $"Shutting down $prog: "
+ killproc ripngd
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ripngd
+ echo
+ ;;
+ restart|reload)
+ $0 stop
+ $0 start
+ RETVAL=$?
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/ripngd ]; then
+ $0 stop
+ $0 start
+ fi
+ RETVAL=$?
+ ;;
+ status)
+ status ripngd
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
+ exit 1
+esac
+
+exit $RETVAL
diff --git a/redhat/zebra.init b/redhat/zebra.init
new file mode 100644
index 00000000..5a450e21
--- /dev/null
+++ b/redhat/zebra.init
@@ -0,0 +1,61 @@
+#!/bin/bash
+#
+# chkconfig: - 15 85
+# description: GNU Zebra routing manager
+#
+# processname: zebra
+# config: /etc/zebra/zebra.conf
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+# Check that networking is up.
+[ "${NETWORKING}" = "no" ] && exit 0
+
+# The process must be configured first.
+[ -f /etc/zebra/zebra.conf ] || exit 0
+
+RETVAL=0
+
+prog="zebra"
+
+case "$1" in
+ start)
+ echo -n $"Starting $prog: "
+
+ /sbin/ip route flush proto zebra
+
+ daemon /usr/sbin/zebra -d
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zebra
+ echo
+ ;;
+ stop)
+ echo -n $"Shutting down $prog: "
+ killproc zebra
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zebra
+ echo
+ ;;
+ restart|reload)
+ $0 stop
+ $0 start
+ RETVAL=$?
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/zebra ]; then
+ $0 stop
+ $0 start
+ fi
+ RETVAL=$?
+ ;;
+ status)
+ status zebra
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
+ exit 1
+esac
+
+exit $RETVAL
diff --git a/redhat/zebra.logrotate b/redhat/zebra.logrotate
new file mode 100644
index 00000000..2e352ff6
--- /dev/null
+++ b/redhat/zebra.logrotate
@@ -0,0 +1,59 @@
+/var/log/zebra/zebra.log {
+ notifempty
+ missingok
+ nocompress
+ weekly
+ postrotate
+ /usr/sbin/killall -USR1 zebra
+ endscript
+}
+
+/var/log/zebra/bgpd.log {
+ notifempty
+ missingok
+ nocompress
+ weekly
+ postrotate
+ /usr/sbin/killall -USR1 bgpd
+ endscript
+}
+
+/var/log/zebra/ospfd.log {
+ notifempty
+ missingok
+ nocompress
+ weekly
+ postrotate
+ /usr/sbin/killall -USR1 ospfd
+ endscript
+}
+
+/var/log/zebra/ospf6d.log {
+ notifempty
+ missingok
+ nocompress
+ weekly
+ postrotate
+ /usr/sbin/killall -USR1 ospf6d
+ endscript
+}
+
+/var/log/zebra/ripd.log {
+ notifempty
+ missingok
+ nocompress
+ weekly
+ postrotate
+ /usr/sbin/killall -USR1 ripd
+ endscript
+}
+
+/var/log/zebra/ripngd.log {
+ notifempty
+ missingok
+ nocompress
+ weekly
+ postrotate
+ /usr/sbin/killall -USR1 ripngd
+ endscript
+}
diff --git a/redhat/zebra.pam b/redhat/zebra.pam
index 1390edf4..fb17f59e 100644
--- a/redhat/zebra.pam
+++ b/redhat/zebra.pam
@@ -1,26 +1,10 @@
#%PAM-1.0
#
-
-##### if running zebra as root:
# Only allow root (and possibly wheel) to use this because enable access
# is unrestricted.
-# auth sufficient /lib/security/pam_rootok.so
+auth sufficient /lib/security/pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth sufficient /lib/security/pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
#auth required /lib/security/pam_wheel.so use_uid
-###########################################################
-
-# If using zebra privileges and with a seperate group for vty access, then
-# access can be controlled via the vty access group, and pam can simply
-# check for valid user/password
-#
-# only allow local users.
-auth required /lib/security/pam_securetty.so
-auth required /lib/security/pam_stack.so service=system-auth
-auth required /lib/security/pam_nologin.so
-account required /lib/security/pam_stack.so service=system-auth
-password required /lib/security/pam_stack.so service=system-auth
-session required /lib/security/pam_stack.so service=system-auth
-session optional /lib/security/pam_console.so
diff --git a/redhat/zebra.spec.in b/redhat/zebra.spec.in
index 85b3b318..ce3a6fb4 100644
--- a/redhat/zebra.spec.in
+++ b/redhat/zebra.spec.in
@@ -1,4 +1,4 @@
-# configure options
+# conditionals
%define with_snmp 0
%define with_vtysh 1
%define with_ospf_te 1
@@ -11,8 +11,6 @@
%define with_ospfclient 1
%define with_ospfapi 1
%define with_multipath 64
-%define zebra_user zebra
-%define vty_group zebravty
# path defines
%define _sysconfdir /etc/zebra
@@ -24,12 +22,12 @@
%define _libexecdir %{_exec_prefix}/libexec/zebra
%define _includedir %{_prefix}/include/zebra
%define _libdir %{_exec_prefix}/%{_lib}/zebra
-%define _localstatedir /var/run/zebra
+%define _localstatedir %{_prefix}/var/run
Summary: Routing daemon
Name: zebra
Version: @VERSION@
-Release: @CONFDATE@01
+Release: @CONFDATE@
License: GPL
Group: System Environment/Daemons
Source0: ftp://ftp.zebra.org/pub/zebra/%{name}-%{version}.tar.gz
@@ -82,7 +80,10 @@ developing OSPF-API and zebra applications.
%setup -q
%build
+./update-autotools
%configure \
+ --with-cflags="-O2" \
+ --enable-netlink \
%if %with_ipv6
--enable-ipv6 \
%endif
@@ -118,17 +119,12 @@ developing OSPF-API and zebra applications.
--enable-ospfapi=no \
%endif
%if %with_pam
- --with-libpam \
+ --with-libpam
%endif
-%if %zebra_user
- --enable-user=%zebra_user \
- --enable-group=%zebra_user \
-%endif
-%if %vty_group
- --enable-vty-group=%vty_group \
-%endif
---with-cflags="-O2" \
---enable-netlink
+
+pushd vtysh
+make %{?_smp_mflags} rebuild
+popd
make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
@@ -155,18 +151,6 @@ install %{zeb_rh_src}/ospfd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd
install %{zeb_rh_src}/ripd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd
install -m644 %{zeb_rh_src}/zebra.pam $RPM_BUILD_ROOT/etc/pam.d/zebra
install -m644 %{zeb_rh_src}/zebra.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/zebra
-install -d -m750 $RPM_BUILD_ROOT/var/run/zebra
-
-%pre
-# add vty_group
-%if %vty_group
-groupadd -r %vty_group 2> /dev/null || :
-%endif
-# add zebra user and group
-%if %zebra_user
-/usr/sbin/useradd -M -r -s /bin/false -c "Zebra routing suite" \
- -d %_localstatedir %zebra_user 2> /dev/null || :
-%endif
%post
# zebra_spec_add_service <service name> <port/proto> <comment>
@@ -251,19 +235,9 @@ fi
%doc doc/zebra.html
%doc doc/mpls
%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
-%if %zebra_user
-%dir %attr(751,%zebra_user,%zebra_user) %{_sysconfdir}
-%dir %attr(750,%zebra_user,%zebra_user) /var/log/zebra
-%dir %attr(751,%zebra_user,%zebra_user) /var/run/zebra
-%else
%dir %attr(750,root,root) %{_sysconfdir}
%dir %attr(750,root,root) /var/log/zebra
%dir %attr(755,root,root) /usr/share/info
-%dir %attr(750,root,root) /var/run/zebra
-%endif
-%if %vty_group
-%attr(750,%zebra_user,%vty_group) %{_sysconfdir}/vtysh.conf.sample
-%endif
%{_infodir}/*info*
%{_mandir}/man*/*
%{_sbindir}/*
@@ -288,9 +262,6 @@ fi
%endif
%changelog
-* Tue Mar 20 2003 Paul Jakma <paul@dishone.st>
-- zebra privileges support
-
* Mon Mar 18 2003 Paul Jakma <paul@dishone.st>
- Fix mem leak in 'show thread cpu'
- Ralph Keller's OSPF-API