RedHat: Fail openafs-client 'stop' on rmmod error
[openafs.git] / src / packaging / RedHat / openafs-client.init
index 2de4dd4..caaf890 100644 (file)
@@ -4,6 +4,7 @@
 #
 # chkconfig: 2345 50 50
 # description: OpenAFS is a distributed filesystem.
+# Should-Start: dkms
 #
 # $Revision$
 
 
 
 start() {
+        echo -n $"Updating CellServDB: "
+        cat /usr/vice/etc/CellServDB.local /usr/vice/etc/CellServDB.dist > \
+               /usr/vice/etc/CellServDB
+        chmod 644 /usr/vice/etc/CellServDB
+        echo
        echo -n $"Starting openafs-client: "
        if [ -e /var/lock/subsys/openafs-client ] ; then
                echo -n $"cannot start openafs-client: already running"
@@ -31,6 +37,7 @@ start() {
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/openafs-client
+       [ $RETVAL -eq 0 ] && [ "$AFS_POST_INIT" ] && $AFS_POST_INIT
        return $RETVAL
 }
 
@@ -46,14 +53,18 @@ 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
 }
 
 rhstatus() {
        status afsd
+       return $?
 }
 
 restart() {
@@ -73,6 +84,7 @@ case "$1" in
         ;;
   status)
         rhstatus
+       exit $?
         ;;
   condrestart)
         [ -f /var/lock/subsys/openafs-client ] && restart || :