]> git.puffer.fish Git - matthieu/frr.git/commitdiff
distro/redhat: add mpls and ldpd
authorRenato Westphal <renato@opensourcerouting.org>
Mon, 12 Sep 2016 19:54:56 +0000 (16:54 -0300)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 23 Sep 2016 13:31:17 +0000 (09:31 -0400)
redhat/Makefile.am
redhat/README.rpm_build.md
redhat/ldpd.init [new file with mode: 0644]
redhat/quagga.logrotate
redhat/quagga.spec.in
redhat/quagga.sysconfig

index 20bca27cb2e5f67ed833c70342c7d315c850161c..96870689dca725ecd9367fa3f4dae6d2d94e7d99 100644 (file)
@@ -1,6 +1,6 @@
 
 EXTRA_DIST = bgpd.init isisd.init \
-       ospf6d.init ospfd.init  \
+       ospf6d.init ospfd.init ldpd.init \
        quagga.logrotate quagga.pam quagga.spec \
        quagga.sysconfig ripd.init ripngd.init  \
        watchquagga.init pimd.init  zebra.init  \
index 3e8fa053064725fd5b433471bf664b5fdbf61598..05a0bdc591707c621c04d39d0c2a65eec4deabda 100644 (file)
@@ -52,6 +52,8 @@ Building your own Quagga RPM
                %{!?with_rtadv:        %global  with_rtadv      1 }
                %{!?with_isisd:        %global  with_isisd      1 }
                %{!?with_pimd:         %global  with_pimd       1 }
+               %{!?with_mpls:         %global  with_mpls       0 }
+               %{!?with_ldpd:         %global  with_ldpd       0 }
                %{!?with_shared:       %global  with_shared     1 }
                %{!?with_multipath:    %global  with_multipath  64 }
                %{!?quagga_user:       %global  quagga_user     quagga }
diff --git a/redhat/ldpd.init b/redhat/ldpd.init
new file mode 100644 (file)
index 0000000..b9b9538
--- /dev/null
@@ -0,0 +1,72 @@
+#!/bin/bash
+# chkconfig: - 16 84
+# config: /etc/quagga/ldpd.conf
+
+### BEGIN INIT INFO
+# Provides: ldpd
+# Short-Description: LDP engine
+# Description: LDP engine for use with Zebra
+### END INIT INFO
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# quagga command line options
+. /etc/sysconfig/quagga
+
+RETVAL=0
+PROG="ldpd"
+cmd=ldpd
+LOCK_FILE=/var/lock/subsys/ldpd
+CONF_FILE=/etc/quagga/ldpd.conf
+
+case "$1" in
+  start)
+       # Check that networking is up.
+       [ "${NETWORKING}" = "no" ] && exit 1
+
+       # The process must be configured first.
+       [ -f $CONF_FILE ] || exit 6
+       if [ `id -u` -ne 0 ]; then
+               echo $"Insufficient privilege" 1>&2
+               exit 4
+       fi
+
+       echo -n $"Starting $PROG: "
+       daemon $cmd -d $LDPD_OPTS -f $CONF_FILE
+       RETVAL=$?
+       [ $RETVAL -eq 0 ] && touch $LOCK_FILE
+       echo
+       ;;
+  stop)
+       echo -n $"Shutting down $PROG: "
+       killproc $cmd
+       RETVAL=$?
+       [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
+       echo
+       ;;
+  restart|reload|force-reload)
+       $0 stop
+       $0 start
+       RETVAL=$?
+       ;;
+  condrestart|try-restart)
+       if [ -f $LOCK_FILE ]; then
+               $0 stop
+               $0 start
+       fi
+       RETVAL=$?
+       ;;
+  status)
+       status $cmd
+       RETVAL=$?
+       ;;
+  *)
+       echo $"Usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}"
+       exit 2
+esac
+
+exit $RETVAL
index afbd40c02fd62dcbf1c68fbd85f577ccce37b4f9..1f1baead0bccd4db9b842664451054c59c7900bc 100644 (file)
        /bin/kill -USR1 `cat /var/run/quagga/ripngd.pid 2> /dev/null` 2> /dev/null || true
     endscript
 }
+
+/var/log/quagga/ldpd.log {
+    notifempty
+    missingok
+    postrotate
+       /bin/kill -USR1 `cat /var/run/quagga/ldpd.pid 2> /dev/null` 2> /dev/null || true
+    endscript
+}
index 9ff65e9a22e4f500ec098d049bb8a0f688ec514a..40c30e40ae271efbfb5152cffab455de365ddb74 100644 (file)
@@ -16,6 +16,8 @@
 %{!?with_ospfapi:              %global with_ospfapi            1 }
 %{!?with_irdp:                 %global with_irdp               1 }
 %{!?with_rtadv:                        %global with_rtadv              1 }
+%{!?with_mpls:                 %global with_mpls               0 }
+%{!?with_ldpd:                 %global with_ldpd               0 }
 %{!?with_shared:               %global with_shared             1 }
 %{!?with_multipath:            %global with_multipath          256 }
 %{!?quagga_user:               %global quagga_user             quagga }
 
 %define                daemon_list     zebra ripd ospfd bgpd isisd pimd ripngd ospfd6d
 
+%if %{with_ldpd}
+%define         daemon_ldpd    ldpd
+%else
+%define                daemon_ldpd     ""
+%endif
+
 %if %{with_watchquagga}
 %define         daemon_watchquagga     watchquagga
 %else
 %define                daemon_watchquagga      ""
 %endif
 
-%define                all_daemons     %{daemon_list} %{daemon_watchquagga}
+%define                all_daemons     %{daemon_list} %{daemon_ldpd} %{daemon_watchquagga}
 
 # allow build dir to be kept
 %{!?keep_build:                %global         keep_build      0 }
@@ -198,6 +206,16 @@ developing OSPF-API and quagga applications.
 %else
        --enable-rtadv=no \
 %endif
+%if %{with_mpls}
+       --enable-mpls=yes \
+%else
+       --disable-mpls \
+%endif
+%if %{with_ldpd}
+       --enable-ldpd \
+%else
+       --disable-ldpd \
+%endif
 %if %{with_pam}
        --with-libpam \
 %endif
@@ -315,6 +333,9 @@ zebra_spec_add_service ospfapi  2607/tcp "OSPF-API"
 %endif
 zebra_spec_add_service isisd    2608/tcp "ISISd vty"
 zebra_spec_add_service pimd     2611/tcp "PIMd vty"
+%if %{with_ldpd}
+zebra_spec_add_service ldpd     2612/tcp "LDPd vty"
+%endif
 
 %if "%{initsystem}" == "systemd"
 for daemon in %all_daemons ; do
@@ -493,6 +514,9 @@ rm -rf %{buildroot}
 %{_sbindir}/ospf6d
 %{_sbindir}/pimd
 %{_sbindir}/isisd
+%if %{with_ldpd}
+%{_sbindir}/ldpd
+%endif
 %if %{with_shared}
 %attr(755,root,root) %{_libdir}/lib*.so
 %attr(755,root,root) %{_libdir}/lib*.so.*
@@ -513,6 +537,9 @@ rm -rf %{buildroot}
        %config /etc/rc.d/init.d/ospf6d
        %config /etc/rc.d/init.d/isisd
        %config /etc/rc.d/init.d/pimd
+       %if %{with_ldpd}
+               %config /etc/rc.d/init.d/ldpd
+       %endif
 %endif
 %config(noreplace) /etc/default/quagga
 %config(noreplace) /etc/pam.d/quagga
index 2092cba2fa0989302c34447ec3c56ad74bd4a92e..0cc6acfbae8ba3856c6184a134672a35ff0e9d31 100644 (file)
@@ -9,6 +9,7 @@ RIPD_OPTS="-A 127.0.0.1"
 RIPNGD_OPTS="-A ::1"
 ZEBRA_OPTS="-A 127.0.0.1"
 PIMD_OPTS="-A 127.0.0.1"
+LDPD_OPTS="-A 127.0.0.1"
 
 # Watchquagga configuration for LSB initscripts
 #