linux-afsd-rc-better-defaulting-20050320
authorJason McCormick <jasonmc@cert.org>
Sun, 20 Mar 2005 15:00:43 +0000 (15:00 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sun, 20 Mar 2005 15:00:43 +0000 (15:00 +0000)
FIXES 17630

default to a small cache rather than breaking if the client is ill-configured

src/afsd/afs.rc.linux

index b704f46..5b2405d 100644 (file)
@@ -220,9 +220,16 @@ generate_cacheinfo() {
        if [ "$PART" = "NONE" ]; then
            echo "$CACHE or /usr/vice is not a separate partition"
            echo "you have to change the cachesize in $SYSCNF by hand"
-           exit 1
+           echo "AFS will be started with a VERY small cache of 8Mb."
+           CACHESIZE=8000
        else
-           PARTSIZE=`echo $LINE | awk '{print $2}'`
+           # Check to see if df has pretty-printed for long dev (i.e. LVM)
+            FCHAR=`echo $LINE | cut -c 1`
+            if [ "$FCHAR" = "/" ]; then
+                PARTSIZE=`echo $LINE | awk '{print $2}'`
+            else
+                PARTSIZE=`echo $LINE | awk '{print $1}'`
+           fi
            CACHESIZE=`echo $PARTSIZE | awk '{printf "%d",int(($1*.8)/1000)*1000}'`
        fi
     fi