redhat: do not overwite the server CellServDB
[openafs.git] / src / packaging / RedHat / openafs-client.init
index a2cdfb6..579085c 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 $"Updating SuidCells: "
-        cat /usr/vice/etc/SuidCells.local /usr/vice/etc/SuidCells.dist > \
-               /usr/vice/etc/SuidCells
-        chmod 644 /usr/vice/etc/SuidCells
-        echo
+       if [ -h /usr/vice/etc/CellServDB ]; then
+               rm -f /usr/vice/etc/CellServDB
+       fi
+       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"
@@ -41,6 +40,7 @@ start() {
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/openafs-client
+       [ $RETVAL -eq 0 ] && [ "$AFS_POST_INIT" ] && $AFS_POST_INIT
        return $RETVAL
 }
 
@@ -56,14 +56,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() {
@@ -83,6 +87,7 @@ case "$1" in
         ;;
   status)
         rhstatus
+       exit $?
         ;;
   condrestart)
         [ -f /var/lock/subsys/openafs-client ] && restart || :