[OpenAFS] small improvement for Linux rc script

Tino Schwarze tino.schwarze@informatik.tu-chemnitz.de
Wed, 26 Jun 2002 13:17:45 +0200


--h31gzZEtNLTqOjlF
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi there,
I've just decided to take a minute to improve the init-script for Linux
since I've been going back and forth for several days with someone who
had difficulties in getting AFS to start and I figured out that he
simply had the kernel module already loaded.

Patch attached.

HTH! Tino.

-- 
             * LINUX - Where do you want to be tomorrow? *
                  http://www.tu-chemnitz.de/linux/tag/

--h31gzZEtNLTqOjlF
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="openafs-1.2.5-rc-improvement.patch"

--- openafs-1.2.5/src/afsd/afs.rc.linux.org	Wed Jun 26 14:11:47 2002
+++ openafs-1.2.5/src/afsd/afs.rc.linux	Wed Jun 26 14:13:59 2002
@@ -200,9 +200,13 @@
 		exit 1
 	fi
 
-	# use the prefix command if required
-	set_prefix
-	/sbin/insmod ${PREFIX:+-P $PREFIX} -f -m $MODLOADDIR/$LIBAFS > $MODLOADDIR/libafs.map 2>&1
+	if grep '^libafs-' /proc/modules > /dev/null ; then
+		echo "An AFS module is already loaded. Not loading again."
+	else
+		# use the prefix command if required
+		set_prefix
+		/sbin/insmod ${PREFIX:+-P $PREFIX} -f -m $MODLOADDIR/$LIBAFS > $MODLOADDIR/libafs.map 2>&1
+	fi
 }
 
 generate_cacheinfo() {

--h31gzZEtNLTqOjlF--