From 00e3b7aa3b9d2bd859e137992e5b199a9fdb582c Mon Sep 17 00:00:00 2001 From: Martin Winter Date: Mon, 17 Apr 2017 18:34:32 -0700 Subject: [PATCH] redhat: fix upgrade script (%postun), remove invalid mpls package selection (it's always built and auto detected), add ldpd Signed-off-by: Martin Winter --- redhat/frr.spec.in | 88 +++++----------------------------------------- 1 file changed, 8 insertions(+), 80 deletions(-) diff --git a/redhat/frr.spec.in b/redhat/frr.spec.in index 4c6875aaf5..46cdb9e134 100644 --- a/redhat/frr.spec.in +++ b/redhat/frr.spec.in @@ -16,7 +16,6 @@ %{!?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_nhrpd: %global with_nhrpd 1 } %{!?with_shared: %global with_shared 1 } @@ -217,9 +216,9 @@ developing OSPF-API and frr applications. %endif --enable-vtysh \ %if %{with_ospfclient} - --enable-ospfclient=yes \ + --enable-ospfclient \ %else - --enable-ospfclient=no\ + --disable-ospfclient\ %endif %if %{with_ospfapi} --enable-ospfapi=yes \ @@ -236,11 +235,6 @@ developing OSPF-API and frr applications. %else --enable-rtadv=no \ %endif -%if %{with_mpls} - --enable-mpls=yes \ -%else - --disable-mpls \ -%endif %if %{with_ldpd} --enable-ldpd \ %else @@ -436,85 +430,19 @@ fi %postun if [ "$1" -ge 1 ]; then - # Find out which daemons need to be restarted. - for daemon in %all_daemons ; do - if [ x"${daemon}" != x"" ] ; then - if [ -f /var/lock/subsys/${daemon} ]; then - eval restart_${daemon}=yes - else - eval restart_${daemon}=no - fi - fi - done - # Rename restart flags for daemons handled specially. - running_zebra="$restart_zebra" - restart_zebra=no - %if %{with_watchfrr} - running_watchfrr="$restart_watchfrr" - restart_watchfrr=no - %endif - + # + # Upgrade from older version + # %if "%{initsystem}" == "systemd" ## ## Systemd Version ## - # No watchfrr for systemd version - # - # Stop all daemons other than zebra. - for daemon in %all_daemons ; do - if [ x"${daemon}" != x"" ] ; then - eval restart=\$restart_${daemon} - [ "$restart" = yes ] && \ - %systemd_postun ${daemon}.service - : - fi - done - # Restart zebra. - [ "$running_zebra" = yes ] && \ - %systemd_postun_with_restart $daemon.service - # Start all daemons other than zebra. - for daemon in %all_daemons ; do - if [ x"${daemon}" != x"" ] ; then - eval restart=\$restart_${daemon} - [ "$restart" = yes ] && \ - %systemd_post ${daemon}.service - : - fi - done + %systemd_postun frr.service %else ## ## init.d Version ## - %if %{with_watchfrr} - # Stop watchfrr first. - [ "$running_watchfrr" = yes ] && \ - /etc/rc.d/init.d/watchfrr stop >/dev/null 2>&1 - %endif - # Stop all daemons other than zebra and watchfrr. - for daemon in %all_daemons ; do - if [ x"${daemon}" != x"" ] ; then - eval restart=\$restart_${daemon} - [ "$restart" = yes ] && \ - /etc/rc.d/init.d/${daemon} stop >/dev/null 2>&1 - fi - done - # Restart zebra. - [ "$running_zebra" = yes ] && \ - /etc/rc.d/init.d/zebra restart >/dev/null 2>&1 - # Start all daemons other than zebra and watchfrr. - for daemon in %all_daemons ; do - if [ x"${daemon}" != x"" ] ; then - eval restart=\$restart_${daemon} - [ "$restart" = yes ] && \ - /etc/rc.d/init.d/${daemon} start >/dev/null 2>&1 - fi - done - %if %{with_watchfrr} - # Start watchfrr last. - # Avoid postun scriptlet error if watchfrr is not running. - [ "$running_watchfrr" = yes ] && \ - /etc/rc.d/init.d/watchfrr start >/dev/null 2>&1 || : - %endif + /etc/rc.d/init.d/frr restart >/dev/null 2>&1 %endif fi @@ -526,7 +454,7 @@ fi if [ "$1" = "0" ]; then for daemon in %all_daemons ; do if [ x"${daemon}" != x"" ] ; then - %systemd_preun ${daemon}.service + %systemd_preun frr.service fi done fi