]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
rpm: Don't attempt to restart on upgrade when using systemd
authorGeoffrey Thomas <geofft@mit.edu>
Sun, 11 Dec 2011 10:06:24 +0000 (05:06 -0500)
committerDerrick Brashear <shadow@dementix.org>
Tue, 3 Jan 2012 18:38:10 +0000 (10:38 -0800)
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.

Reviewed-on: http://gerrit.openafs.org/6247
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit dee93ff1d114da711df345e06b5e1a682c877315)

Change-Id: I4ecf3b2f307a81549e0bd568ab5e4585a2ef1f2d
Reviewed-on: http://gerrit.openafs.org/6492
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/packaging/RedHat/openafs.spec.in

index 0fea06a00968bc111ac0c31d464917e94d465dda..c4c408fbb72cab597c1dcc1c21a8bfe4f4f97761 100644 (file)
@@ -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
 
 ##############################################################################