From dee93ff1d114da711df345e06b5e1a682c877315 Mon Sep 17 00:00:00 2001 From: Geoffrey Thomas Date: Sun, 11 Dec 2011 05:06:24 -0500 Subject: [PATCH] rpm: Don't attempt to restart on upgrade when using systemd 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 the client 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 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. While we're here, clean up a redundant BuildRequires on systemd-units. Change-Id: I3b1771a7246f04be0e82765976664c50e0adae47 Reviewed-on: http://gerrit.openafs.org/6247 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/packaging/RedHat/openafs.spec.in | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/packaging/RedHat/openafs.spec.in b/src/packaging/RedHat/openafs.spec.in index 4e75077..8c1fdba 100644 --- a/src/packaging/RedHat/openafs.spec.in +++ b/src/packaging/RedHat/openafs.spec.in @@ -316,7 +316,6 @@ To a kernel module for your running kernel, just run: Requires: binutils, openafs = %{version} %if 0%{?fedora} >= 15 Requires: systemd-units -BuildRequires: systemd-units Requires(post): systemd-units, systemd-sysv Requires(preun): systemd-units Requires(postun): systemd-units @@ -347,7 +346,6 @@ Summary: OpenAFS Filesystem Server Group: Networking/Filesystems %if 0%{?fedora} >= 15 Requires: systemd-units -BuildRequires: systemd-units Requires(post): systemd-units, systemd-sysv Requires(preun): systemd-units Requires(postun): systemd-units @@ -1390,17 +1388,9 @@ fi %if 0%{?fedora} >= 15 %postun client /bin/systemctl daemon-reload >/dev/null 2>&1 || : -if [ $1 -ge 1 ] ; then - # Package upgrade, not uninstall - /bin/systemctl try-restart openafs-client.service >/dev/null 2>&1 || : -fi %postun server /bin/systemctl daemon-reload >/dev/null 2>&1 || : -if [ $1 -ge 1 ] ; then - # Package upgrade, not uninstall - /bin/systemctl try-restart openafs-server.service >/dev/null 2>&1 || : -fi %endif %if %{build_dkmspkg} @@ -1466,12 +1456,8 @@ dkms remove -m %{name} -v %{dkms_version} --rpm_safe_upgrade --all ||: # to migrate them to systemd targets /usr/bin/systemd-sysv-convert --save openafs-client >/dev/null 2>&1 ||: -# If the package is allowed to autostart: -/bin/systemctl --no-reload enable openafs-client.service >/dev/null 2>&1 ||: - -# Run these because the SysV package being removed won't do them +# Run this because the SysV package being removed won't do it /sbin/chkconfig --del openafs-client >/dev/null 2>&1 || : -/bin/systemctl try-restart openafs-client.service >/dev/null 2>&1 || : %triggerun -- openafs-server < 1.6.0-1 # Save the current service runlevel info @@ -1479,12 +1465,8 @@ dkms remove -m %{name} -v %{dkms_version} --rpm_safe_upgrade --all ||: # to migrate them to systemd targets /usr/bin/systemd-sysv-convert --save openafs-server >/dev/null 2>&1 ||: -# If the package is allowed to autostart: -/bin/systemctl --no-reload enable openafs-server.service >/dev/null 2>&1 ||: - -# Run these because the SysV package being removed won't do them +# Run this because the SysV package being removed won't do it /sbin/chkconfig --del openafs-server >/dev/null 2>&1 || : -/bin/systemctl try-restart openafs-server.service >/dev/null 2>&1 || : %endif ############################################################################## -- 1.9.4