mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-03 01:32:31 +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_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
|
||||
|
Loading…
Reference in New Issue
Block a user