Sample scstadmin .conf added
authorvlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Mon, 27 Aug 2007 10:01:48 +0000 (10:01 +0000)
committervlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Mon, 27 Aug 2007 10:01:48 +0000 (10:01 +0000)
git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@171 d57e44dd-8a1f-0410-8b47-8ef2f437770f

iscsi-scst/etc/initd/initd
iscsi-scst/etc/scst.conf [new file with mode: 0644]

index 14e124f..b58a478 100644 (file)
@@ -5,6 +5,11 @@
 
 PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
 MEM_SIZE=1048576
+SCST_CMD=/usr/local/sbin/scstadmin
+SCST_CFG=/etc/scst.conf
+
+# Additional modules to load/unload
+ADD_MODULES="scst_vdisk scst"
 
 configure_memsize()
 {
@@ -40,15 +45,22 @@ configure_memsize()
 start_server()
 {
 #      configure_memsize
-       modprobe -q crc32c
-       modprobe iscsi-scst
+
+       modprobe iscsi-scst || { exit $? ; }
+       for module in ${ADD_MODULES}; do
+               modprobe ${module} || { exit 1 ; }
+       done
+
+       $SCST_CMD -config $SCST_CFG || { exit $? ; }
+
        /usr/local/sbin/iscsi-scstd
 }
 
 stop_server()
 {
        killall iscsi-scstd
-       rmmod -w iscsi-scst
+       rmmod -w iscsi-scst || { exit $? ; }
+       rmmod ${ADD_MODULES} || { exit $? ; }
 }
 
 case "$1" in
diff --git a/iscsi-scst/etc/scst.conf b/iscsi-scst/etc/scst.conf
new file mode 100644 (file)
index 0000000..765a427
--- /dev/null
@@ -0,0 +1,23 @@
+[HANDLER vdisk]
+#DEVICE <vdisk name>,<device path>,<options>,<block size>
+DEVICE disk1,/path/disk1,,512
+DEVICE hdc1,/dev/hdc1,BIO,512
+DEVICE nullio,none,NIO,1024
+
+[HANDLER vcdrom]
+#DEVICE <vdisk name>,<device path>
+
+[ASSIGNMENT Default]
+#DEVICE <device name>,<lun>
+
+[GROUP Default_iqn.2007-05.com.example:storage.disk2.sys1.xyz]
+# This user isn't needed in this default group, but current version of
+# scstadmin (0.7.1) has a problem that it refuses to create a group if
+# it doesn't have at least one user.
+USER NULL_USER
+
+[ASSIGNMENT Default_iqn.2007-05.com.example:storage.disk2.sys1.xyz]
+#DEVICE <device name>,<lun>
+DEVICE disk1,0
+DEVICE hdc1,1
+DEVICE nullio,3