]> git.openfabrics.org - ~emulex/ofed_scripts/.git/commitdiff
Set open-iscsi for auto-startup when installing OFED
authorErez Zilber <erezz@voltaire.com>
Sun, 6 Apr 2008 07:04:50 +0000 (10:04 +0300)
committerErez Zilber <erezz@voltaire.com>
Sun, 6 Apr 2008 07:04:50 +0000 (10:04 +0300)
Since openibd is set to auto-startup/shutdown during OFED installation, we
should also set open-iscsi for auto-startup/shutdown. When shutting down
the machine, openibd is stopped, and it tries to unload modules that are
used by iSER. Stopping open-iscsi before openibd solves this problem.

Signed-off-by: Erez Zilber <erezz@voltaire.com>
install.pl
uninstall.sh

index b3bd528449820201d6c8ee9e10829c8fa8a65ecd..8036be3d827016320561a6f876be618c682d14fd 100755 (executable)
@@ -3255,6 +3255,28 @@ sub install_rpm
     if ($build32 and $packages_info{$name}{'install32'}) {
         install_rpm_32($name);
     }
+
+    # Set open-iscsi for auto startup
+    if ($name eq $packages_info{'open-iscsi-generic'}{'name'}) {
+        if ($distro eq "SuSE") {
+            $res = system("/sbin/insserv open-iscsi > /dev/null 2>&1");
+            if ($res) {
+                print RED "Failed to set open-iscsi for auto-startup", RESET "\n";
+                exit 1;
+            }
+        } elsif ($distro eq "redhat" or $distro eq "redhat5") {
+            $res = system("/sbin/chkconfig --del iscsi > /dev/null 2>&1");
+            if ($res) {
+                print RED "Failed to set open-iscsi for manual startup", RESET "\n";
+                exit 1;
+            }
+            $res = system("/sbin/chkconfig --add iscsi > /dev/null 2>&1");
+            if ($res) {
+                print RED "Failed to set open-iscsi for auto-startup", RESET "\n";
+                exit 1;
+            }
+        }
+    }
 }
 
 sub print_package_info
index aac134836e81ae3fd3e3865a6512ac9341cfc32a..d16bd0ce3dcba4f69aab9e88ec5bbd2b4ca0af09 100755 (executable)
@@ -120,11 +120,13 @@ uninstall()
     case ${DISTRIBUTION} in
         SuSE)
         if ( $RPM -q ${OPEN_ISCSI_SUSE_NAME} > $NULL 2>&1 ) && ( $RPM --queryformat "[%{VENDOR}]" -q ${OPEN_ISCSI_SUSE_NAME} | grep -i Voltaire > $NULL 2>&1 ); then
+            ex "/sbin/insserv -r open-iscsi"
             ex "$RPM -e ${OPEN_ISCSI_SUSE_NAME}"
         fi
         ;;
         redhat)
         if ( $RPM -q ${OPEN_ISCSI_REDHAT_NAME} > $NULL 2>&1 ) && ( $RPM --queryformat "[%{VENDOR}]" -q ${OPEN_ISCSI_REDHAT_NAME} | grep -i Voltaire > $NULL 2>&1 ); then
+            ex "/sbin/chkconfig --del iscsi"
             ex "$RPM -e ${OPEN_ISCSI_REDHAT_NAME}"
         fi
         ;;