]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Exit successfully in init script if openafs isn't in modules.dep
authorRuss Allbery <rra@debian.org>
Sat, 28 Jun 2008 06:01:22 +0000 (23:01 -0700)
committerRuss Allbery <rra@debian.org>
Sat, 28 Jun 2008 06:01:22 +0000 (23:01 -0700)
If the openafs module isn't listed in modules.dep, exit with a zero
status from the init script even if modprobe fails.  Otherwise, if a
module package and openafs-client are installed at the same time and
openafs-client is set up before the module package, the init script can
find the module, fail the modprobe (because the dependency map hasn't
yet been updated), and fail the whole installation.  Exiting with a zero
status still doesn't get OpenAFS started, but at least it doesn't leave
the system in a partly installed state.  Thanks to Durk Strooisma for the
analysis.

Closes: #486816
debian/changelog
debian/openafs-client.init

index edf8bdfa6dabaac5f9708e4d1a644b357a639368..5c3e67be93e8fc6b97c31465a8b301e5fd216bd5 100644 (file)
@@ -3,6 +3,15 @@ openafs (1.4.7.dfsg1-3) UNRELEASED; urgency=low
   * When clearing the restart time while installing a new cell, pass
     -localauth to avoid an authentication failure.  Thanks, Davor Ocelic.
     (Closes: #488152)
+  * If the openafs module isn't listed in modules.dep, exit with a zero
+    status from the init script even if modprobe fails.  Otherwise, if a
+    module package and openafs-client are installed at the same time and
+    openafs-client is set up before the module package, the init script
+    can find the module, fail the modprobe (because the dependency map
+    hasn't yet been updated), and fail the whole installation.  Exiting
+    with a zero status still doesn't get OpenAFS started, but at least it
+    doesn't leave the system in a partly installed state.  Thanks to Durk
+    Strooisma for the analysis.  (Closes: #486816)
   * Stop using quilt to manage patches and pre-apply them to the source
     package now that the package is maintained with Git.
   * Translation updates:
index 969cf513305c2464756bb2bcafd999358221dafd..69f4a1c951f65103d44d732bc45d8f7f35c0d3e8 100755 (executable)
@@ -28,7 +28,8 @@
 PATH=/bin:/usr/bin:/sbin:/usr/sbin
 
 CACHEINFO=${CACHEINFO:-/etc/openafs/cacheinfo}
-MODULEDIR=${MODULEDIR:-/lib/modules/`uname -r`/fs}
+MODULEROOT=${MODULEROOT:-/lib/modules/`uname -r`}
+MODULEDIR=${MODULEDIR:-$MODULEROOT/fs}
 
 exec 3>/dev/null
 exec </dev/null
@@ -78,7 +79,9 @@ choose_client() {
 }
 
 # Load the AFS client module if it's not already loaded.  Set $MODULEDIR and
-# $LIBAFS to override the default location and module name.
+# $LIBAFS to override the default location and module name.  Also check before
+# loading whether the module is listed in the module dependencies so that we
+# can exit with a 0 status in that case.
 load_client() {
     if [ -z "$LIBAFS" ] ; then
         choose_client
@@ -94,6 +97,10 @@ EOF
         # installation unless a module is installed.
         exit 0
     fi
+    sawdep=0
+    if grep -q openafs "$MODULEROOT/modules.dep" ; then
+        sawdep=1
+    fi
     LOADED=`/sbin/lsmod | fgrep openafs`
     if [ -z "$LOADED" ] ; then
         modprobe openafs
@@ -101,7 +108,16 @@ EOF
         if [ $status = 0 ] ; then
             echo -n " openafs"
         fi
-        return $status
+
+        # We must exit successfully here if the openafs module just isn't
+        # listed in the dependency information for modprobe, which can happen
+        # if openafs-client and the module package are installed at the same
+        # time and the module hasn't been set up yet.
+        if [ $sawdep = 0 ] ; then
+            return 0
+        else
+            return $status
+        fi
     fi
     return 0
 }