]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
RedHat: Fail openafs-client 'stop' on rmmod error
authorAndrew Deason <adeason@sinenomine.net>
Wed, 8 Feb 2012 22:03:29 +0000 (16:03 -0600)
committerDerrick Brashear <shadow@dementix.org>
Thu, 23 Feb 2012 01:56:24 +0000 (17:56 -0800)
Currently, the openafs-client RPM init script ignores any error
reported by rmmod. If 'umount /afs' succeeds but rmmod does not, the
client may panic the machine if the client is started again (from e.g.
running the 'restart' init script method), since afsd will try to
initialize AFS with a libafs that has been shut down.

So, do not ignore errors from 'rmmod', and instead fail the 'stop'
method from the init script if we get an error.

Reviewed-on: http://gerrit.openafs.org/6709
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 12e2a3abe7ca640a7cef2630039c06964f779f17)

Change-Id: I31256abac839c9011754445efa09960f061fdbb0
Reviewed-on: http://gerrit.openafs.org/6757
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/packaging/RedHat/openafs-client.init

index f07ff1662a429b461e94935cbd8eb4e255979ed9..caaf89095b446d298206f553b41db6fb4190fbad 100644 (file)
@@ -53,8 +53,11 @@ stop() {
        RETVAL=$?
        echo
        if [ $RETVAL -eq 0 ] ; then
-               rm -f /var/lock/subsys/openafs-client
                rmmod openafs
+               RETVAL=$?
+       fi
+       if [ $RETVAL -eq 0 ] ; then
+               rm -f /var/lock/subsys/openafs-client
        fi
        return $RETVAL
 }