RedHat: Fail openafs-client 'stop' on rmmod error

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.

Change-Id: Id4a07703fb4df69ad3a6a3569c91e48f73a0d309
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>
This commit is contained in:
Andrew Deason 2012-02-08 16:03:29 -06:00 committed by Derrick Brashear
parent aaab21e7a1
commit 12e2a3abe7

View 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
}