mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-06 18:17:48 +00:00
redhat: fix upgrade script (%postun), remove invalid mpls package selection (it's always built and auto detected), add ldpd
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
This commit is contained in:
parent
2931e394e9
commit
00e3b7aa3b
@ -16,7 +16,6 @@
|
|||||||
%{!?with_ospfapi: %global with_ospfapi 1 }
|
%{!?with_ospfapi: %global with_ospfapi 1 }
|
||||||
%{!?with_irdp: %global with_irdp 1 }
|
%{!?with_irdp: %global with_irdp 1 }
|
||||||
%{!?with_rtadv: %global with_rtadv 1 }
|
%{!?with_rtadv: %global with_rtadv 1 }
|
||||||
%{!?with_mpls: %global with_mpls 0 }
|
|
||||||
%{!?with_ldpd: %global with_ldpd 0 }
|
%{!?with_ldpd: %global with_ldpd 0 }
|
||||||
%{!?with_nhrpd: %global with_nhrpd 1 }
|
%{!?with_nhrpd: %global with_nhrpd 1 }
|
||||||
%{!?with_shared: %global with_shared 1 }
|
%{!?with_shared: %global with_shared 1 }
|
||||||
@ -217,9 +216,9 @@ developing OSPF-API and frr applications.
|
|||||||
%endif
|
%endif
|
||||||
--enable-vtysh \
|
--enable-vtysh \
|
||||||
%if %{with_ospfclient}
|
%if %{with_ospfclient}
|
||||||
--enable-ospfclient=yes \
|
--enable-ospfclient \
|
||||||
%else
|
%else
|
||||||
--enable-ospfclient=no\
|
--disable-ospfclient\
|
||||||
%endif
|
%endif
|
||||||
%if %{with_ospfapi}
|
%if %{with_ospfapi}
|
||||||
--enable-ospfapi=yes \
|
--enable-ospfapi=yes \
|
||||||
@ -236,11 +235,6 @@ developing OSPF-API and frr applications.
|
|||||||
%else
|
%else
|
||||||
--enable-rtadv=no \
|
--enable-rtadv=no \
|
||||||
%endif
|
%endif
|
||||||
%if %{with_mpls}
|
|
||||||
--enable-mpls=yes \
|
|
||||||
%else
|
|
||||||
--disable-mpls \
|
|
||||||
%endif
|
|
||||||
%if %{with_ldpd}
|
%if %{with_ldpd}
|
||||||
--enable-ldpd \
|
--enable-ldpd \
|
||||||
%else
|
%else
|
||||||
@ -436,85 +430,19 @@ fi
|
|||||||
|
|
||||||
%postun
|
%postun
|
||||||
if [ "$1" -ge 1 ]; then
|
if [ "$1" -ge 1 ]; then
|
||||||
# Find out which daemons need to be restarted.
|
#
|
||||||
for daemon in %all_daemons ; do
|
# Upgrade from older version
|
||||||
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
|
|
||||||
|
|
||||||
%if "%{initsystem}" == "systemd"
|
%if "%{initsystem}" == "systemd"
|
||||||
##
|
##
|
||||||
## Systemd Version
|
## Systemd Version
|
||||||
##
|
##
|
||||||
# No watchfrr for systemd version
|
%systemd_postun frr.service
|
||||||
#
|
|
||||||
# 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
|
|
||||||
%else
|
%else
|
||||||
##
|
##
|
||||||
## init.d Version
|
## init.d Version
|
||||||
##
|
##
|
||||||
%if %{with_watchfrr}
|
/etc/rc.d/init.d/frr restart >/dev/null 2>&1
|
||||||
# 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
|
|
||||||
%endif
|
%endif
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -526,7 +454,7 @@ fi
|
|||||||
if [ "$1" = "0" ]; then
|
if [ "$1" = "0" ]; then
|
||||||
for daemon in %all_daemons ; do
|
for daemon in %all_daemons ; do
|
||||||
if [ x"${daemon}" != x"" ] ; then
|
if [ x"${daemon}" != x"" ] ; then
|
||||||
%systemd_preun ${daemon}.service
|
%systemd_preun frr.service
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user