Ignore:
Timestamp:
Dec 11, 2011, 4:33:10 AM (13 years ago)
Author:
geofft
Message:
openafs.spec: Don't attempt to restart OpenAFS on upgrade (Trac: #274)

systemd is actually rather capable of leaving the OpenAFS client in an
incredibly broken state, thanks to its willingness to track services and
kill their processes.  We should not attempt to restart it on upgrade,
whether a normal upgrade or a migration from SysV initscripts. In the
former case, it's fine (and correct) for the old AFS to keep running; in
the latter case, the unit file is capable of correctly shutting down an
initscript-launched client. The same is true for the OpenAFS server.

This brings the packaging in line with the SysV-style initscript code in
the specfile, which does not attempt to restart the service, as well as
with e.g. Debian's packaging, which uses --no-restart-on-upgrade.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/fedora/specs/openafs-systemd.spec.patch

    r2066 r2089  
    1 --- rpmbuild/SPECS/openafs.spec.orig    2011-10-17 23:46:35.000000000 -0400
    2 +++ rpmbuild/SPECS/openafs.spec 2011-10-17 23:48:41.000000000 -0400
     1--- openafs.spec.orig   2011-12-11 03:16:10.725175932 -0500
     2+++ openafs.spec        2011-12-11 04:22:10.313676135 -0500
    33@@ -224,7 +224,7 @@
    44 BuildRoot: %{_tmppath}/%{name}-%{version}-root
     
    1010 BuildRequires: perl-devel perl-ExtUtils-Embed
    1111 %endif
    12 @@ -323,6 +323,12 @@
     12@@ -326,6 +326,12 @@
    1313 %package client
    1414 Provides: scripts-openafs-client
     
    2323 %if %{fedorakmod}
    2424 Requires: %{name}-kmod >= %{version}
    25 @@ -347,6 +353,12 @@
     25@@ -350,6 +356,12 @@
    2626 Requires: openafs = %{version}
    2727 Summary: OpenAFS Filesystem Server
     
    3636 %description server
    3737 The AFS distributed filesystem.  AFS is a distributed filesystem
    38 @@ -999,7 +1011,12 @@
     38@@ -1005,7 +1017,12 @@
    3939 mkdir -p $RPM_BUILD_ROOT%{_sbindir}
    4040 mkdir -p $RPM_BUILD_ROOT%{_libdir}
     
    4949 mkdir -p $RPM_BUILD_ROOT%{pamdir}
    5050 mkdir -p $RPM_BUILD_ROOT%{_prefix}/afs/etc
    51 @@ -1029,8 +1046,14 @@
     51@@ -1035,8 +1052,14 @@
    5252 
    5353 # Copy root.client config files
     
    6464 # Copy PAM modules
    6565 install -m 755 ${sysname}/dest/lib/pam* $RPM_BUILD_ROOT%{pamdir}
    66 @@ -1310,7 +1333,14 @@
     66@@ -1318,7 +1341,14 @@
    6767 fi
    6868 
     
    7979        mkdir /afs
    8080        chown root.root /afs
    81 @@ -1327,10 +1357,17 @@
     81@@ -1335,10 +1365,17 @@
    8282 
    8383 %post server
     
    9797 %if %{build_authlibs}
    9898 %post authlibs
    99 @@ -1346,16 +1383,45 @@
     99@@ -1354,16 +1391,37 @@
    100100 fi
    101101 
     
    129129+%postun client
    130130+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
    131 +if [ $1 -ge 1 ] ; then
    132 +    # Package upgrade, not uninstall
    133 +    /bin/systemctl try-restart openafs-client.service >/dev/null 2>&1 || :
    134 +fi
    135131+
    136132+%postun server
    137133+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
    138 +if [ $1 -ge 1 ] ; then
    139 +    # Package upgrade, not uninstall
    140 +    /bin/systemctl try-restart openafs-server.service >/dev/null 2>&1 || :
    141 +fi
    142134 
    143135 %if %{build_dkmspkg}
    144136 %post -n dkms-%{name}
    145 @@ -1413,6 +1479,32 @@
     137@@ -1421,6 +1479,24 @@
    146138 %endif
    147139 %endif
     
    153145+/usr/bin/systemd-sysv-convert --save openafs-client >/dev/null 2>&1 ||:
    154146+
    155 +# If the package is allowed to autostart:
    156 +/bin/systemctl --no-reload enable openafs-client.service >/dev/null 2>&1 ||:
    157 +
    158 +# Run these because the SysV package being removed won't do them
     147+# Run this because the SysV package being removed won't do it
    159148+/sbin/chkconfig --del openafs-client >/dev/null 2>&1 || :
    160 +/bin/systemctl try-restart openafs-client.service >/dev/null 2>&1 || :
    161149+
    162150+%triggerun -- openafs-server < 1.6.0-1
     
    166154+/usr/bin/systemd-sysv-convert --save openafs-server >/dev/null 2>&1 ||:
    167155+
    168 +# If the package is allowed to autostart:
    169 +/bin/systemctl --no-reload enable openafs-server.service >/dev/null 2>&1 ||:
    170 +
    171 +# Run these because the SysV package being removed won't do them
     156+# Run this because the SysV package being removed won't do it
    172157+/sbin/chkconfig --del openafs-server >/dev/null 2>&1 || :
    173 +/bin/systemctl try-restart openafs-server.service >/dev/null 2>&1 || :
    174158+
    175159 ##############################################################################
    176160 ###
    177161 ### file lists
    178 @@ -1450,7 +1542,12 @@
     162@@ -1458,7 +1534,12 @@
    179163 %{pamdir}/pam_afs.krb.so
    180164 %{pamdir}/pam_afs.so.1
     
    189173 %{_mandir}/man1/copyauth.*
    190174 %{_mandir}/man1/up.*
    191 @@ -1498,7 +1595,11 @@
     175@@ -1506,7 +1587,11 @@
    192176 %{_sbindir}/vldb_check
    193177 %{_sbindir}/vldb_convert
Note: See TracChangeset for help on using the changeset viewer.