Commit Graph

313 Commits

Author SHA1 Message Date
Bart Van Assche
6b6bcca4c8 scstadmin: Ensure that the version number can be parsed from inside Makefile.PL
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4988 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-09-06 06:39:25 +00:00
Bart Van Assche
f94393b43c scstadmin: Enable targets after the ALUA configuration has been restored
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4942 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-04 18:16:51 +00:00
Bart Van Assche
2c67878832 scstadmin: Add ALUA attribute support
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4941 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-04 18:15:28 +00:00
Bart Van Assche
5d6b0142a8 scstadmin: Fix parsing names of multi-valued attributes
When defining e.g. more than ten CHAP users in scst.conf, scstadmin
only saves the first then CHAP users. Make sure that scstadmin saves
all information defined in sysfs.

Reported-by: Artur Piechocki <artur.piechocki@open-e.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4928 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-07-30 10:49:02 +00:00
Bart Van Assche
dfe644834c scstadmin: Save multi-valued attributes sorted
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4927 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-07-30 10:41:15 +00:00
Bart Van Assche
21c8cfa9f1 scstadmin: Escape special characters in initiator names in the LUN masking section
Write out e.g. "INITIATOR iqn.1994-05.com.redhat:29a5cc399d\#192.168.11.1"
instead of "INITIATOR iqn.1994-05.com.redhat:29a5cc399d#192.168.11.1" when
generating a config file such that the hash sign is read in properly when
rereading the SCST config file.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4907 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-07-01 11:57:19 +00:00
Vladislav Bolkhovitin
84f6cb5dae scst_vdisk: Add support for nullio "dummy" LUNs
While the SCSI specifications require presence of LUN 0 it is not always
desirable to associate storage with LUN 0. Hence allow LUN 0 (or any
other LUN) to be configured such that it does not appear at the
initiator side. This is realized by adding a "dummy" attribute in to
NULLIO vdisk devices. If that attribute is set, the PERIPHERAL QUALIFIER
field in the INQUIRY response is set to 1 and the PERIPHERAL DEVICE TYPE
is set to 0x1f. Add an example in the scst.conf(5) man page that shows
how to use the new attribute.

Signed-off-by: Bart Van Assche <bvanassche@acm.org> with some fixes and simplifications



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4874 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-05-22 03:48:26 +00:00
Bart Van Assche
f709ef3150 scstadmin: Speed up restoring a configuration about 40% by caching certain /sys/kernel/scst_tgt/ query results
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4833 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-04-08 07:30:06 +00:00
Bart Van Assche
d48169fb47 scstadmin: lsb-core is no longer required, so remove the lsb-core check
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4823 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-27 10:11:31 +00:00
Bart Van Assche
ab0b9743b4 scstadmin: Do not save duplicate target information in the ALUA sections
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4808 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-20 14:47:17 +00:00
Vladislav Bolkhovitin
369863f015 Allow install SCST in any location
Currently the install location of SCST is pretty much hard coded into 
the Makefiles to be /usr/local.

I am custom building a system for ZFS & SCST and I want to install in 
/usr instead of /usr/local.

Currently I am doing a “find . -name Makefile -exec sed -i 's:/usr/local:/usr:g'
{} \;” to accommodate this.

This patch fixes it.

From Sietse van Zanen <sietse@wizdom.nu>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4791 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-08 21:25:45 +00:00
Bart Van Assche
2005f20144 scstadmin: Correct release-archive target
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4734 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-13 17:52:31 +00:00
Bart Van Assche
14a4b165d8 scstadmin: Add release-archive target
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4732 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-13 17:48:15 +00:00
Mark Buechler
3fa995bb29 Truncate config file instead of deleting it before writing.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4728 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-11 17:59:51 +00:00
Bart Van Assche
82fcc41287 /etc/init.d/scst: Change one tab into a space
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4686 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-06 09:32:40 +00:00
Bart Van Assche
97e8aa1f08 /etc/init.d/scst: Introduce character classes
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4685 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-06 09:32:00 +00:00
Bart Van Assche
88376b1577 /etc/init.d/scst: Revert r4151 and hence restore r4023 since this setting is needed again for openSUSE 12.2 systems
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4684 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-06 09:14:39 +00:00
Mark Buechler
e75a90ef5e Fix 0-named groups. Patch by Alexey Obitotskiy, originally identified by Marcin Haba.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4639 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-05 15:14:30 +00:00
Bart Van Assche
e838840e6b scstadmin/Makefile: Use chkconfig on RHEL instead of the LSB scripts
chkconfig is installed by default while /usr/lib/lsb/install_initd and
/usr/lib/lsb/remove_initd are not installed by default.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4612 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-09 12:04:58 +00:00
Bart Van Assche
45e27bfa42 scstadmin/Makefile: Clean up whitespace usage
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4611 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-09 10:36:59 +00:00
Bart Van Assche
413a68a53e scstadmin, Ubuntu: Use update-rc.d instead of the LSB /usr/lib/lsb/remove_initd - the latter is not installed by default
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4609 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-08 14:25:37 +00:00
Bart Van Assche
37431aae60 /etc/init.d/scst: Wait up to 30s before giving up trying to unload a kernel module
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4608 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-08 14:23:13 +00:00
Bart Van Assche
62ba210a31 scstadmin: Create /etc/default if it does not yet exist
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4537 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-01 13:25:28 +00:00
Bart Van Assche
f79293427a scstadmin: Use $(DESTDIR) when uninstalling SCST 2.x startup scripts
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4536 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-01 13:24:46 +00:00
Vladislav Bolkhovitin
7b1f00d2cb Increase version to -pre2. Pre1 was staying for too long.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4519 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-14 01:33:58 +00:00
Bart Van Assche
f11ebeafe4 [PATCH] scstadmin: Handle -EAGAIN when reading from sysfs
Reading from /sys/kernel/scst_tgt/devices/*/filename can (at
least in theory) fail with -EAGAIN. Make sure that scstadmin
retries reading from a sysfs variable if that happens. This
patch has been tested by adding the following error injection
code in scst_sysfs.c:

 --------------------------- scst/src/scst_sysfs.c ----------------------------
index 0509703..69efd80 100644
@@ -523,6 +523,22 @@ int scst_sysfs_queue_wait_work(struct scst_sysfs_work_item *work)
 			"failed: %d", atomic_read(&uid_thread_name),
 			(int)PTR_ERR(t));

+#if 1
+	{
+		static int cnt;
+		if (!work->read_only_action || cnt++ % 4 < 3) {
+			/*
+			 * Helps testing user space code that writes to or
+			 * reads from SCST sysfs variables.
+			 */
+			timeout = 0;
+			rc = 0;
+			res = -EAGAIN;
+			goto out_put;
+		}
+	}
+#endif
+
 	while (1) {
 		rc = wait_for_completion_interruptible_timeout(
 			&work->sysfs_work_done, timeout);
 ------------------------------------------------------------------------------

Signed-off-by: Bart Van Assche <bvanassche@acm.org>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4498 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-30 14:47:49 +00:00
Mark Buechler
03f3be2ccb - Add -no_lip option to prevent automatically issueing a LIP after a configuration change.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4474 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-27 14:38:54 +00:00
Bart Van Assche
95246ee9d7 scstadmin: Make _syswrite() translate EBUSY into "writing failed"
_syswrite() callers check whether writing into an SCST sysfs attribute
succeeded by checking whether the value returned by this function is
defined(). Return undef (failed) instead of -1 (success) if syswrite()
returned error code EBUSY (found this through source reading). Return
$length instead of length($cmd) if the initial write triggered EAGAIN.
Remove a superfluous $bytes = undef statement. Eliminate the variable
$wait.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4400 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-07-09 06:12:47 +00:00
Bart Van Assche
db5b92274a scstadmin: Allow hash signs to be escaped
Hash signs have to be specified in scst.conf when using the per_portal_acl=1
feature of iSCSI-SCST in combination with LUN masking. Make scstadmin not
consider hash signs preceded by a backslash as the start of a comment. Escape
backslashes and hash signs when writing out scst.conf.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4391 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-06-29 13:43:36 +00:00
Bart Van Assche
e28130bb2f scstadmin, FC, NPIV: Make -write_config save the "node_name" and "parent_host"
attributes.

Reported-by: Dimitri Puzin <max@psycast.de>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4306 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-05-17 15:08:57 +00:00
Bart Van Assche
c569b7e8a1 scstadmin: Rework r4304.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4305 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-05-17 12:54:42 +00:00
Bart Van Assche
00caf4d5c9 scstadmin: Make -write_config save the scst_local session name
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4304 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-05-17 12:18:48 +00:00
Bart Van Assche
1a0b957efc /etc/init.d/scst: When parsing /etc/scst.conf for "TARGET_DRIVER ... {", accept blanks at the end of the line.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4259 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-05-01 18:17:24 +00:00
Bart Van Assche
b72ffcf4e3 scstadmin, scst.conf man page: Add example for fcst
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4181 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-04-03 06:58:03 +00:00
Bart Van Assche
81fff819d6 scstadmin: Make /etc/init.d/scst status work on RHEL 6.2. Apparently RHEL 6.2 doesn't define the function rc_status in /lib/lsb/init-functions.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4163 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-03-18 12:05:45 +00:00
Bart Van Assche
87dd12ac73 scstadmin: Suggest the user to use systemctl (systemd) instead of the LSB installation script if available
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4153 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-03-04 14:17:53 +00:00
Bart Van Assche
3da8048c71 scstadmin: Only enable /etc/init.d/scst in runlevels 3 and 5 since networking is not available in runlevels 2 or 4
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4152 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-03-04 14:16:51 +00:00
Bart Van Assche
02b431ec24 scstadmin: Revert r4023 since bug https://bugzilla.novell.com/show_bug.cgi?id=738281 has been fixed
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4151 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-03-04 14:13:52 +00:00
Bart Van Assche
448a7bdd29 scstadmin: Replace scstadmin/scstadmin by a soft link if it is a regular file. This is a workaround for a bug in the "Download tarball" functionality of the SourceForge website
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4129 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-02-15 10:02:06 +00:00
Bart Van Assche
cb5cc4592c scstadmin: Document the ISCSID_OPTIONS variable in the /etc/default/scst man page. That variable was added in r4066.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4073 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-16 10:23:06 +00:00
Bart Van Assche
372373cf5f scstadmin: Allow iscsi-scstd command-line options to be specified in /etc/default/scst
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4066 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-12 17:36:49 +00:00
Bart Van Assche
a7d2282fd0 Make "/etc/init.d/scst status" exit with code 3 instead of 0 if SCST has not been started, as required by the LSB. Fixes a bug introduced in r3805.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4047 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-02 12:08:33 +00:00
Vladislav Bolkhovitin
6d8ca195f7 openSUSE 12.1 automatically transforms commands like
"/etc/init.d/scst start" into a systemd start command. Since that doesn't
work for the SCST init script, disable systemd wrapping.

See also bug #738281 "Upgrading from openSUSE 11.4 to openSUSE 12.1 breaks third-party
LSB-compliant System V style init scripts" in the Novell bugzilla database
(https://bugzilla.novell.com/show_bug.cgi?id=738281).

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4023 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-21 03:02:13 +00:00
Bart Van Assche
c8fc2dd821 /etc/init.d/scst: clarify comments
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3996 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-15 13:03:51 +00:00
Mark Buechler
c866c6f4b1 - Small directory check in _issueLip(). Not sure why this is needed.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3956 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-06 19:41:33 +00:00
Mark Buechler
1bbf50a530 - Warn only in issueLip() when -issue_lip is an argument.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3951 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-05 19:39:59 +00:00
Mark Buechler
9076e2a107 - Fix -issue_lip as reported by Iain Paton.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3934 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-11-18 20:32:01 +00:00
Bart Van Assche
3749844c5f scst initialization: Remove kernel module parameters from /etc/default/scst
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3931 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-11-17 17:52:29 +00:00
Mark Buechler
58bd090c3e Fixed minor config file bug pointed out by Bart Van Assche.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3918 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-11-11 17:50:08 +00:00
Bart Van Assche
b5865c7969 /etc/init.d: When installing SCST 3.0, disable and remove the now obsolete iscsi-scst and qla2x00t init scripts.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3843 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-09-04 11:57:39 +00:00