From 51982c855d7cc214efc45b647ae51bd2817f52ea Mon Sep 17 00:00:00 2001 From: Erez Zilber Date: Sun, 6 Apr 2008 10:04:50 +0300 Subject: [PATCH] Set open-iscsi for auto-startup when installing OFED 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 --- install.pl | 22 ++++++++++++++++++++++ uninstall.sh | 2 ++ 2 files changed, 24 insertions(+) diff --git a/install.pl b/install.pl index b3bd528..8036be3 100755 --- a/install.pl +++ b/install.pl @@ -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 diff --git a/uninstall.sh b/uninstall.sh index aac1348..d16bd0c 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -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 ;; -- 2.41.0