Browse Source

debian/aoetools.init:

- Change Provides: in the LSB header from 'mountaoe' to 'aoe'.
- Add a comment about the loading of the aoe module.
- Rearranged logic a bit, in order to postpone module load until we have a
  valid interface list.  This has the added value of resolving (again) the
  installation in a new system.
David Martínez Moreno 17 years ago
parent
commit
9303b370d4
1 changed files with 14 additions and 9 deletions
  1. 14 9
      debian/aoetools.init

+ 14 - 9
debian/aoetools.init

@@ -9,14 +9,14 @@
 #       Modified for aoetools by David Martínez Moreno <ender@debian.org>.
 #
 ### BEGIN INIT INFO
-# Provides:          mountaoe
+# Provides:          aoe
 # Required-Start:    $local_fs $network
 # Required-Stop:     $local_fs $network
 # Should-Start:      
 # Default-Start:     S
 # Default-Stop:      0 6
 # Short-Description: Begin AoE discovery and mount related filesystems.
-# Description:       Begin AoE discovery and mount filesystems residing.
+# Description:       Begin AoE discovery and mount filesystems residing
 #                    on AoE volumes.
 ### END INIT INFO
 
@@ -35,6 +35,18 @@ fi
 set -e
 
 do_start() {
+    # We exit if the user do not want us to try this.
+    if [ "$INTERFACES" = "none" ]
+    then
+        echo "not started."
+        exit 0
+    fi
+
+    # Usually aoe is a module, so we will try to load it.
+    # Also, if udev is being used, the /dev/etherd devices
+    # are not created until aoe module insertion.
+    modprobe aoe >/dev/null 2>&1 || true
+
     if [ ! -c /dev/etherd/discover ]
     then
         echo "Missing devices under /dev/etherd/.  Please run" >&2
@@ -43,13 +55,6 @@ do_start() {
         exit 1
     fi
 
-    # We exit if the user do not want us to try this.
-    if [ "$INTERFACES" = "none" ]
-    then
-        echo "not started."
-        exit 0
-    fi
-
     # Try to set up interfaces for discovery, if any.
     if [ ! -z "$INTERFACES" ]
     then