diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-10-23 08:32:22 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-23 08:32:22 -0400 |
| commit | 9c9046679d3a257d5838c594627c0a8619c9315e (patch) | |
| tree | 66c63b44212a2b87345e7a30ad6f98c3c8498039 | |
| parent | 4acd566457084980401f02017ea7bc30918f7ab0 (diff) | |
| parent | d8d2a81ff3e8df03847a995597275f546b66f872 (diff) | |
Merge pull request #1351 from opensourcerouting/rpm-fix-2.0
Rpm fix 2.0
| -rw-r--r-- | redhat/daemons | 2 | ||||
| -rw-r--r-- | redhat/frr.spec.in | 44 |
2 files changed, 33 insertions, 13 deletions
diff --git a/redhat/daemons b/redhat/daemons index 689ad9baaa..eeecb4c12b 100644 --- a/redhat/daemons +++ b/redhat/daemons @@ -35,7 +35,7 @@ # group "frrvty" and set to ug=rw,o= though. Check /etc/pam.d/frr, too. # watchfrr_enable=no -watchfrr_options=("-Az" "-b_" "-r/etc/init.d/frr_restart_%s" "-s/etc/init.d/frr_start_%s" "-k/etc/init.d/frr_stop_%s") +watchfrr_options=("-Az" "-b_" "-r/usr/lib/frr/frr_restart_%s" "-s/usr/lib/frr/frr_start_%s" "-k/usr/lib/frr/frr_stop_%s") # zebra=no bgpd=no diff --git a/redhat/frr.spec.in b/redhat/frr.spec.in index 8c555a3c42..8d82d2df1f 100644 --- a/redhat/frr.spec.in +++ b/redhat/frr.spec.in @@ -302,6 +302,8 @@ install %{zeb_rh_src}/frr.init \ %else mkdir -p %{buildroot}/etc/rc.d/init.d install %{zeb_rh_src}/frr.init \ + %{buildroot}%{_sbindir}/frr +ln -s %{_sbindir}/frr \ %{buildroot}/etc/rc.d/init.d/frr %endif @@ -375,6 +377,10 @@ done /sbin/chkconfig --add frr %endif +# Fix bad path in previous config files +# Config files won't get replaced by default, so we do this ugly hack to fix it +%__sed -i 's|/etc/init.d/|%{_sbindir}/|g' %{_sysconfdir}/daemons 2> /dev/null || true + /sbin/install-info %{_infodir}/frr.info.gz %{_infodir}/dir # Create dummy files if they don't exist so basic functions can be used. @@ -415,7 +421,7 @@ if [ ! -e %{_sysconfdir}/vtysh.conf ]; then fi %postun -if [ "$1" -ge 1 ]; then +if [ $1 -ge 1 ]; then # # Upgrade from older version # @@ -423,7 +429,7 @@ if [ "$1" -ge 1 ]; then ## ## Systemd Version ## - %systemd_postun frr.service + %systemd_postun_with_restart frr.service %else ## ## init.d Version @@ -438,24 +444,31 @@ fi ## ## Systemd Version ## - if [ "$1" = "0" ]; then - for daemon in %all_daemons ; do - if [ x"${daemon}" != x"" ] ; then - %systemd_preun frr.service - fi - done + if [ $1 -eq 0 ] ; then + %systemd_preun frr.service fi %else ## ## init.d Version ## - if [ "$1" = "0" ]; then + if [ $1 -eq 0 ] ; then /etc/rc.d/init.d/frr stop >/dev/null 2>&1 /sbin/chkconfig --del frr fi %endif /sbin/install-info --delete %{_infodir}/frr.info.gz %{_infodir}/dir +%posttrans +# We screwed up and didn't correctly add the restart to the RPM script +# with the previous version. postun script is run from the previous version, +# so the fix won't work until the next time. +# We add an additional restart here which should be removed in future +# major versions +%if "%{initsystem}" == "systemd" + systemctl daemon-reload >/dev/null 2>&1 || : + systemctl try-restart frr.service >/dev/null 2>&1 || : +%endif + %clean %if !0%{?keep_build:1} rm -rf %{buildroot} @@ -507,10 +520,11 @@ rm -rf %{buildroot} %config(noreplace) /etc/frr/[!v]*.conf* %config(noreplace) %attr(750,%frr_user,%frr_user) /etc/frr/daemons %if "%{initsystem}" == "systemd" - %config %{_unitdir}/frr.service + %attr(644,root,root) %{_unitdir}/frr.service %{_sbindir}/frr %else - %config /etc/rc.d/init.d/frr + /etc/rc.d/init.d/frr + %{_sbindir}/frr %endif %config(noreplace) /etc/pam.d/frr %config(noreplace) %attr(640,root,root) /etc/logrotate.d/* @@ -542,7 +556,13 @@ rm -rf %{buildroot} %endif %changelog -* Mon Apr 17 2017 Martin Winter <mwinter@opensourcerouting.org> - %{version} +* Fri Oct 20 2017 Martin Winter <mwinter@opensourcerouting.org> - %{version} +- Fix script location for watchfrr restart functions in daemon config +- Fix postun script to restart frr during upgrade +- Add posttrans script to fix missing restart in postun script from 2.0 rpm + package. Will be removed in next major version > 3 again + +* Mon Apr 17 2017 Martin Winter <mwinter@opensourcerouting.org> - new subpackage frr-pythontools with python 2.7 restart script - remove PIMd from CentOS/RedHat 6 RPM packages (won't work - too old) - converted to single frr init script (not per daemon) based on debian init script |
