From: Benjamin Kaduk Date: Thu, 30 Oct 2014 20:07:41 +0000 (-0400) Subject: Separate helper for shutdown module check X-Git-Tag: debian/1.6.10-2~1 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=5f24653c047bdcd738144fc507b8e809511fe8e9;p=packages%2Fo%2Fopenafs.git Separate helper for shutdown module check If a client was running during the upgrade from a sysvinit version of the package, stopping it with the systemd unit file will not necessarily have run the precheck script sufficiently recently to fill in the KMOD variable with openafs, so that the shut-down client would leave the kernel module loaded. This causes great badness when attempting to start the client again. We do not want to reuse the precheck script during shutdown, as it has conditionals on things like "not already running" which are not appropriate there, so use a separate helper script for shutdown. Always unload a module if it's present (unless loading is disabled), to reduce the risk that subsequent starts will have trouble. --- diff --git a/debian/openafs-client-postcheck b/debian/openafs-client-postcheck new file mode 100755 index 000000000..aef53a78f --- /dev/null +++ b/debian/openafs-client-postcheck @@ -0,0 +1,12 @@ +#! /bin/sh +PATH=/bin:/usr/bin:/sbin:/usr/sbin + +# Always unload a module if it's loaded. +if /sbin/lsmod | grep -Fq openafs; then + KMOD=openafs +else + KMOD=--version +fi +cat > /var/cache/openafs-client/openafs-client.shutdown.env <