[stgt] [PATCH 1/2] tgt-admin: allow --ignore-errors to be used in the config file

Tomasz Chmielewski mangoo at wpkg.org
Tue Jan 27 14:39:22 CET 2009


Allow --ignore-errors to be used in the config file.

Rationale: if any of the devices used by the target is inaccessible
(i.e., because it's now a secondary node in DRBD), tgt-admin will not
process all remaining targets, but exit with error somewhere in the middle.
As a result, any (re)connecting initiators may not find the target 
they expect, even if there wouldn't be any errors when configuring 
that target.
This is especially painful if the whole target machine is being restarted
and tgtd startup/configuration happens automatically, in the background.


Signed-off-by: Tomasz Chmielewski <mangoo at wpkg.org>

diff --git a/scripts/tgt-admin b/scripts/tgt-admin
index 634066a..1d3e427 100755
--- a/scripts/tgt-admin
+++ b/scripts/tgt-admin
@@ -165,6 +165,10 @@ sub add_targets {
 				print "Check your config file for errors.\n";
 				exit 1;
 			}
+		} elsif ($k eq "ignore-errors") {
+			if ($conf{$k} eq "yes") {
+				$ignore_errors = 1;
+			}
 		}
 	}
 



-- 
Tomasz Chmielewski
http://wpkg.org
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list