From c5960ed1eaa88be3c40f61626d368f2685ae0daf Mon Sep 17 00:00:00 2001 From: Doron Shoham Date: Wed, 16 Jan 2008 16:45:58 +0200 Subject: 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 --- etc/initd/initd.debian | 9 ++++++++- etc/initd/initd.redhat | 13 ++++++++++++- etc/initd/initd.suse | 9 ++++++++- 3 files changed, 28 insertions(+), 3 deletions(-) (limited to 'etc') 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 -- cgit v1.2.1