summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorDoron Shoham <dorons@voltaire.com>2008-01-16 16:45:58 +0200
committerMike Christie <michaelc@cs.wisc.edu>2008-01-21 16:23:21 -0600
commitc5960ed1eaa88be3c40f61626d368f2685ae0daf (patch)
tree43fa2a810be5cefdcaa752197dfff295275029ac /etc
parentca1c67128213a4220f204a51f4e1c9569e21d9ec (diff)
downloadopen-iscsi-c5960ed1eaa88be3c40f61626d368f2685ae0daf.tar.gz
When stopping open iscsi check that all the modules are going down correctly
While stopping open-iscsi, the initd script removes the modules by running 'modprobe -r'. The retval of modprobe must be tested. Signed-off-by: Doron Shoham <dorons@voltaire.com>
Diffstat (limited to 'etc')
-rw-r--r--etc/initd/initd.debian9
-rw-r--r--etc/initd/initd.redhat13
-rw-r--r--etc/initd/initd.suse9
3 files changed, 28 insertions, 3 deletions
diff --git a/etc/initd/initd.debian b/etc/initd/initd.debian
index 9e9f134..c0dfd1e 100644
--- a/etc/initd/initd.debian
+++ b/etc/initd/initd.debian
@@ -54,9 +54,16 @@ stop() {
log_daemon_msg "Stopping iSCSI initiator service"
start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON
rm -f $PIDFILE
+ status=0
modprobe -r ib_iser 2>/dev/null
+ if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
+ status=1
+ fi
modprobe -r iscsi_tcp 2>/dev/null
- log_end_msg 0
+ if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
+ status=1
+ fi
+ log_end_msg $status
}
restart() {
diff --git a/etc/initd/initd.redhat b/etc/initd/initd.redhat
index 7cf198e..d68f135 100644
--- a/etc/initd/initd.redhat
+++ b/etc/initd/initd.redhat
@@ -42,9 +42,20 @@ stop()
killproc iscsid
rm -f /var/run/iscsid.pid
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/open-iscsi
+ status=0
modprobe -r iscsi_tcp 2>/dev/null
+ if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
+ status=1
+ fi
modprobe -r ib_iser 2>/dev/null
- success
+ if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
+ status=1
+ fi
+ if [ "$status" -eq "0" ]; then
+ success
+ else
+ failure
+ fi
echo
}
diff --git a/etc/initd/initd.suse b/etc/initd/initd.suse
index 163479e..f5009d2 100644
--- a/etc/initd/initd.suse
+++ b/etc/initd/initd.suse
@@ -88,9 +88,16 @@ case "$1" in
echo -n "Stopping iSCSI initiator service: "
if [ "$RETVAL" == "0" ]; then
rm -f $PID_FILE
+ status=0
modprobe -r iscsi_tcp
+ if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
+ status=1
+ fi
modprobe -q -r ib_iser
- rc_failed 0
+ if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
+ status=1
+ fi
+ rc_failed $status
else
rc_failed 1
fi