rc script for I SCSI

Sossi Andrej asossi at dotcom.ts.it
Wed Jan 14 05:36:46 PST 2009


Hello,
I have NAS server with ISCSI. I must mount ISCSI disks at boot time, but 
I didn't find any article on how to do this. Then I wrote a rc script to 
help me to mount disks at boot time.
-----------------
#!/bin/sh
#
 
# PROVIDE: iscsi
# REQUIRE: NETWORKING
# BEFORE: mountlate

iscontrol_enable=${iscontrol_enable-"NO"}
iscontrol_flags=${iscontrol_flags-""}
iscontrol_pidfile=${iscontrol_pidfile-"/var/run/iscontrol.pid"}
 
. /etc/rc.subr
 
name="iscontrol"
rcvar=`set_rcvar`
command="/sbin/${name}"
 
load_rc_config $name
 
pidfile="${iscontrol_pidfile}"
start_cmd="echo \"Starting ${name}.\"; /usr/bin/nice -5 ${command} 
${iscontrol_flags} ${command_args}; sleep 2"
 
run_rc_command "$1"
-----------------

The disk to mount must be in fstab file with the 'late' option. Eg:
/dev/da0s1d               /mnt/iscsi    ufs    rw,late    0    0

Is this the correct way to do this? If yes, is it possible to insert 
this script in the future version of FreeBSD?
Thanks.

-- 
Sossi Andrej
-------------------------
DotCom Information technology

Via Biancospino, 9
34151 - Opicina (TS)
Italy

tel: +39 040 2158191
fax: +39 040 0641954
E-mail: asossi at dotcom.ts.it
----------------------------

Ai sensi del D.lgs n. 196 del 30.06.03 (Codice Privacy) si precisa che le informazioni contenute in questo messaggio sono riservate e ad uso esclusivo del destinatario. Qualora il messaggio in parola Le fosse pervenuto per errore, La preghiamo di eliminarlo senza copiarlo e di non inoltrarlo a terzi, dandocene gentilmente comunicazione. Grazie

This message, for the D.lgs n. 196 / 30.06.03 (Privacy Code), may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.



More information about the freebsd-scsi mailing list