]> git.proxmox.com Git - mirror_frr.git/commitdiff
2003-12-30 Paul Jakma <paul@dishone.st>
authorpaul <paul>
Tue, 30 Dec 2003 11:16:21 +0000 (11:16 +0000)
committerpaul <paul>
Tue, 30 Dec 2003 11:16:21 +0000 (11:16 +0000)
        * redhat/isisd.init: new file, init script for isisd.
          redhat/quagga.sysconfig: new file, sysconfig file for quagga
          initscripts.
          redhat/quagga.spec.in: various cleanups, including sysconfig patch
          from RH, fixed UID/GID as per RH EL, shell changed to
          /sbin/nologin, daemon vty's listen to 127.1 only per default and
          isisd packaged.
          redhat/*.init: sysconfig support and runlevels specified.

ChangeLog
redhat/bgpd.init
redhat/isisd.init [new file with mode: 0644]
redhat/ospf6d.init
redhat/ospfd.init
redhat/quagga.spec.in
redhat/quagga.sysconfig [new file with mode: 0644]
redhat/ripd.init
redhat/ripngd.init
redhat/zebra.init

index fc376275d137fdc88048475c59b571f8d26daf9e..345eea72068d28cf5c2e65881161158bbfd1c566 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2003-12-30 Paul Jakma <paul@dishone.st>
+
+       * redhat/isisd.init: new file, init script for isisd.
+         redhat/quagga.sysconfig: new file, sysconfig file for quagga
+         initscripts. 
+         redhat/quagga.spec.in: various cleanups, including sysconfig patch
+         from RH, fixed UID/GID as per RH EL, shell changed to 
+         /sbin/nologin, daemon vty's listen to 127.1 only per default and 
+         isisd packaged.
+         redhat/*.init: sysconfig support and runlevels specified.
+         
 2003-12-30 Paul Jakma <paul@dishone.st>
 
        * Makefile.am: put the redhat/ stuff into EXTRA_DIST rather than
index 296b91532eb5ad475613943beeca8f17d9b8a095..ef59c2a61f440ab59bb427a9272fcaf475f7ed64 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# chkconfig: - 16 84
+# chkconfig: 2345 16 84
 # description: A BGPv4, BGPv4+, BGPv4- routing engine for use with Zebra
 #
 # processname: bgpd
@@ -12,6 +12,9 @@
 # Get network config
 . /etc/sysconfig/network
 
+# quagga command line options
+. /etc/sysconfig/quagga
+
 # Check that networking is up.
 [ "${NETWORKING}" = "no" ] && exit 0
 
@@ -24,7 +27,7 @@ prog="bgpd"
 case "$1" in
   start)
        echo -n $"Starting $prog: "
-        daemon /usr/sbin/bgpd -d
+        daemon /usr/sbin/bgpd -d $BGPD_OPTS
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bgpd
        echo
diff --git a/redhat/isisd.init b/redhat/isisd.init
new file mode 100644 (file)
index 0000000..0d762c0
--- /dev/null
@@ -0,0 +1,61 @@
+#!/bin/bash
+#
+# chkconfig: 2345 16 84
+# description: An ISIS routing engine for use with Quagga
+#
+# processname: isisd
+# config: /etc/quagga/isisd.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/quagga/isisd.conf ] || exit 0
+
+RETVAL=0
+
+prog="isisd"
+
+case "$1" in
+  start)
+       echo -n $"Starting $prog: "
+        daemon /usr/sbin/isisd -d
+       RETVAL=$?
+       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/isisd
+       echo
+       ;;
+  stop)
+       echo -n $"Shutting down $prog: "
+       killproc isisd
+       RETVAL=$?
+       [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/isisd
+       echo
+       ;;
+  restart|reload)
+        $0 stop
+        $0 start
+       RETVAL=$?
+        ;;
+  condrestart)
+        if [ -f /var/lock/subsys/isisd ]; then
+                $0 stop
+               $0 start
+        fi
+       RETVAL=$?
+        ;;
+  status)
+        status isisd
+       RETVAL=$?
+        ;;
+  *)
+       echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
+       exit 1
+esac
+
+exit $RETVAL
index a54a57e69fdb1934344d9533f2501feeab94f869..c84ce678f34acbbfb63728b8ba5b5b4ed304af53 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# chkconfig: - 16 84
+# chkconfig: 2345 16 84
 # description: An OSPF routing engine for use with Zebra and IPv6
 #
 # processname: ospf6d
@@ -12,6 +12,9 @@
 # Get network config
 . /etc/sysconfig/network
 
+# quagga command line options
+. /etc/sysconfig/quagga
+
 # Check that networking is up.
 [ "${NETWORKING_IPV6}" = "no" ] && exit 0
 
@@ -24,7 +27,7 @@ prog="ospf6d"
 case "$1" in
   start)
        echo -n $"Starting $prog: "
-        daemon /usr/sbin/ospf6d -d
+        daemon /usr/sbin/ospf6d -d $OSPF6D_OPTS
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ospf6d
        echo
index 8e3dae61035462b7e25124a51dad4a588faf3ecb..911f7aa59cf000008e26ba995222fb06a4b9487b 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# chkconfig: - 16 84
+# chkconfig: 2345 16 84
 # description: An OSPF v2 routing engine for use with Zebra
 #
 # processname: ospfd
@@ -12,6 +12,9 @@
 # Get network config
 . /etc/sysconfig/network
 
+# quagga command line options
+. /etc/sysconfig/quagga
+
 # Check that networking is up.
 [ "${NETWORKING}" = "no" ] && exit 0
 
@@ -25,7 +28,7 @@ prog="ospfd"
 case "$1" in
   start)
        echo -n $"Starting $prog: "
-        daemon /usr/sbin/ospfd -d
+        daemon /usr/sbin/ospfd -d $OSPFD_OPTS
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ospfd
        echo
index 5308cc4e23bd96a169dd7e621842b09dbef0a3e3..2512d313d9c9073684ac70ff6b4627daf96b814e 100644 (file)
 
 # defines for configure
 %define                _libexecdir     %{_exec_prefix}/libexec/quagga
-%define                _includedir     %{_prefix}/include/quagga
 %define                _libdir         %{_exec_prefix}/%{_lib}/quagga
+%define                _includedir     %{_prefix}/include
 %define                _localstatedir  /var/run/quagga
 
+# misc internal defines
+%define         quagga_uid      92
+%define         quagga_gid      92
+%if %with_ipv6
+%define                daemon_list     zebra ripd isisd ospfd ripngd ospf6d bgpd
+%else
+%define                daemon_list     zebra ripd isisd ospfd bgpd
+%endif
+
 Summary: Routing daemon
 Name:          quagga
 Version:       @VERSION@
@@ -35,14 +44,14 @@ Group: System Environment/Daemons
 Source0:       http://www.quagga.net/snapshots/cvs/%{name}-%{version}.tar.gz
 URL:           http://www.quagga.net
 %if %with_snmp
-#BuildRequires:        ucd-snmp-devel
+BuildRequires: ucd-snmp-devel
 Prereq:                ucd-snmp
 %endif
 %if %with_vtysh
 BuildRequires: readline readline-devel ncurses ncurses-devel
 Prereq:                readline ncurses
 %endif
-BuildRequires: texinfo tetex autoconf pam-devel patch
+BuildRequires: texinfo tetex autoconf pam-devel patch libcap-devel
 # Initscripts > 5.60 is required for IPv6 support
 Prereq:                initscripts >= 5.60
 Prereq:                ncurses readline pam
@@ -148,16 +157,17 @@ make install \
 # Remove this file, as it is uninstalled and causes errors when building on RH9
 rm -rf $RPM_BUILD_ROOT/usr/share/info/dir
 
-install %{zeb_rh_src}/zebra.init $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra
-install %{zeb_rh_src}/bgpd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd
-%if %with_ipv6
-install %{zeb_rh_src}/ospf6d.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d
-install %{zeb_rh_src}/ripngd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd
-%endif
-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}/quagga.pam $RPM_BUILD_ROOT/etc/pam.d/quagga
-install -m644 %{zeb_rh_src}/quagga.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/quagga
+# install etc sources
+for daemon in %daemon_list ; do
+       install %{zeb_rh_src}/${daemon}.init \
+               $RPM_BUILD_ROOT/etc/rc.d/init.d/${daemon}
+done
+install -m644 %{zeb_rh_src}/quagga.pam \
+       $RPM_BUILD_ROOT/etc/pam.d/quagga
+install -m644 %{zeb_rh_src}/quagga.logrotate \
+       $RPM_BUILD_ROOT/etc/logrotate.d/quagga
+install -m644 %{zeb_rh_src}/quagga.sysconfig \
+       $RPM_BUILD_ROOT/etc/sysconfig/quagga
 install -d -m750  $RPM_BUILD_ROOT/var/run/quagga
 
 %pre
@@ -167,7 +177,9 @@ groupadd -r %vty_group 2> /dev/null || :
 %endif
 # add quagga user and group
 %if %quagga_user
-/usr/sbin/useradd -M -r -s /bin/false -c "Quagga routing suite" \
+/usr/sbin/groupadd -g %quagga_gid quagga 2> /dev/null || :
+/usr/sbin/useradd  -u %quagga_uid -g %quagga_gid \
+ -M -r -s /sbin/nologin -c "Quagga routing suite" \
  -d %_localstatedir %quagga_user 2> /dev/null || :
 %endif
 
@@ -199,14 +211,9 @@ zebra_spec_add_service ospfapi  2607/tcp "OSPF-API"
 %endif
 zebra_spec_add_service isisd    2608/tcp "ISISd vty"
 
-/sbin/chkconfig --add zebra 
-/sbin/chkconfig --add ripd
-%if %with_ipv6
-/sbin/chkconfig --add ripngd
-/sbin/chkconfig --add ospf6d
-%endif
-/sbin/chkconfig --add ospfd
-/sbin/chkconfig --add bgpd
+for daemon in %daemon_list ; do
+       /sbin/chkconfig --add ${daemon}
+done
 
 /sbin/install-info %{_infodir}/quagga.info.gz %{_infodir}/dir
 
@@ -222,31 +229,18 @@ fi
 
 %postun
 if [ "$1" -ge  "1" ]; then
-       /etc/rc.d/init.d/zebra  condrestart >/dev/null 2>&1
-       /etc/rc.d/init.d/ripd   condrestart >/dev/null 2>&1
-%if %with_ipv6
-       /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1
-%endif
-       /etc/rc.d/init.d/ospfd  condrestart >/dev/null 2>&1
-%if %with_ipv6
-       /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1
-%endif
-       /etc/rc.d/init.d/bgpd   condrestart >/dev/null 2>&1
+       for daemon in %daemon_list ; do
+               /etc/rc.d/init.d/${daemon} condrestart >/dev/null 2>&1
+       done
 fi
-/sbin/install-info --delete %{_infodir}/quagga.info.gz %{_infodir}/dir
 
 %preun
 if [ "$1" = "0" ]; then
-        /sbin/chkconfig --del zebra
-       /sbin/chkconfig --del ripd
-%if %with_ipv6
-       /sbin/chkconfig --del ripngd
-%endif
-       /sbin/chkconfig --del ospfd
-%if %with_ipv6
-       /sbin/chkconfig --del ospf6d
-%endif
-       /sbin/chkconfig --del bgpd
+       for daemon in %daemon_list ; do
+               /etc/rc.d/init.d/${daemon} stop  >/dev/null 2>&1
+               /sbin/chkconfig --del ${daemon}
+       done
+       /sbin/install-info --delete %{_infodir}/quagga.info.gz %{_infodir}/dir
 fi
 
 %clean
@@ -279,6 +273,7 @@ fi
 %endif
 %config /etc/quagga/[!v]*
 %config /etc/rc.d/init.d/*
+%config(noreplace) /etc/sysconfig/quagga
 %config(noreplace) /etc/pam.d/quagga
 %config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
 
@@ -289,13 +284,25 @@ fi
 %files devel
 %defattr(-,root,root)
 %dir %{_libdir}/*
-%dir %{_includedir}/*.h
-%dir %{_includedir}/ospfd/*
+%dir %{_includedir}/%name/*.h
+%dir %{_includedir}/%name/ospfd/*.h
 %if %with_ospfapi
-%dir %{_includedir}/ospfapi/*
+%dir %{_includedir}/%name/ospfapi/*.h
 %endif
 
 %changelog
+%changelog
+* Tue Dec 30 2003 Paul Jakma <paul@dishone.st>
+- sync to CVS
+- integrate RH sysconfig patch to specify daemon options (RH)
+- default to have vty listen only to 127.1 (RH)
+- add user with fixed UID/GID (RH)
+- create user with shell /sbin/nologin rather than /bin/false (RH)
+- stop daemons on uninstall (RH)
+- delete info file on %preun, not %postun to avoid deletion on upgrade. (RH)
+- isisd added
+- cleanup tasks carried out for every daemon
+
 * Sun Nov 2 2003 Paul Jakma <paul@dishone.st>
 - Fix -devel package to include all files
 - Sync to 0.96.4
diff --git a/redhat/quagga.sysconfig b/redhat/quagga.sysconfig
new file mode 100644 (file)
index 0000000..fc905af
--- /dev/null
@@ -0,0 +1,9 @@
+#
+# Default: Bind all daemon vtys to the loopback(s) only
+#
+BGPD_OPTS="-A 127.0.0.1"
+OSPF6D_OPTS="-A ::1"
+OSPFD_OPTS="-A 127.0.0.1"
+RIPD_OPTS="-A 127.0.0.1"
+RIPNGD_OPTS="-A ::1"
+ZEBRA_OPTS="-A 127.0.0.1"
index 3545a7440a78d9e6ec70c99b12dbeeecae6d588c..766422194d003f633a5e934d3f031b133ba1b30d 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# chkconfig: - 16 84
+# chkconfig: 2345 16 84
 # description: A RIP routing engine for use with Zebra
 #
 # processname: ripd
@@ -12,6 +12,9 @@
 # Get network config
 . /etc/sysconfig/network
 
+# quagga command line options
+. /etc/sysconfig/quagga
+
 # Check that networking is up.
 [ "${NETWORKING}" = "no" ] && exit 0
 
@@ -24,7 +27,7 @@ prog="ripd"
 case "$1" in
   start)
        echo -n $"Starting $prog: "
-        daemon /usr/sbin/ripd -d
+        daemon /usr/sbin/ripd -d $RIPD_OPTS
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ripd
        echo
index 4d552e3cdc4a456d85ac486b77e685935df6de71..57ae928c72e9c0e78e3fe01fe2eae255da4d7658 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# chkconfig: - 16 84
+# chkconfig: 2345 16 84
 # description: A RIP routing engine for use with Zebra and IPv6
 #
 # processname: ripngd
@@ -12,6 +12,9 @@
 # Get network config
 . /etc/sysconfig/network
 
+# quagga command line options
+. /etc/sysconfig/quagga
+
 # Check that networking is up.
 [ "${NETWORKING_IPV6}" = "no" ] && exit 0
 
@@ -24,7 +27,7 @@ prog="ripngd"
 case "$1" in
   start)
        echo -n $"Starting $prog: "
-        daemon /usr/sbin/ripngd -d
+        daemon /usr/sbin/ripngd -d $RIPNGD_OPTS
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ripngd
        echo
index 16b7a499ff18fcf29e72c939e2a3b4ee1ae62368..8caae1f167345cb9232bdfdd5ac9272c6fd5b9f8 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# chkconfig: - 15 85
+# chkconfig: 2345 15 85
 # description: GNU Zebra routing manager
 #
 # processname: zebra
@@ -9,6 +9,9 @@
 # source function library
 . /etc/rc.d/init.d/functions
 
+# quagga command line options
+. /etc/sysconfig/quagga
+
 # Check that networking is up.
 [ "${NETWORKING}" = "no" ] && exit 0
 
@@ -25,7 +28,7 @@ case "$1" in
 
        /sbin/ip route flush proto zebra
                        
-        daemon /usr/sbin/zebra -d
+        daemon /usr/sbin/zebra -d $ZEBRA_OPTS
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zebra
        echo