FreeBSD + ISCSi + Openfiler


Does anyone know how to make FreeBSD 7 add the iscsi targets automatically after reboot ??

P.S. Configuring /etc/iscsi.conf and iscsi_initiator_load="yes" in /boot/loader.conf doesn't do the job.

And I'm not looking for some workaround like cron @reboot.

I searched all the man pages but didn't find anything.
The loader.conf addition will load the kernel module at boot, and /etc/iscsi.conf defines the targets you (might) want to use. To actually attach a target to the initiator you need to run "iscontrol -n NAME", where NAME is one of the targets you have defined in iscsi.conf.

I would like to see an rc script that attaches specified targets at boot but unfortunately there is not one included with the base system currently. That doesn't mean you can't write your own, however. IIRC there are even example scripts floating around, though I don't have a link to one handy.
it works with cron
@reboot (iscontrol -n target; sleep 10; mount /dev/daX /path)

The thing is that an rc script would be useless, if you want to have the filesystem mounted at boot time within /etc/fstab.
How about /usr/local/etc/rc.d/ with following line:

iscontrol -n target
sleep 10
mount /dev/daX /path

See rc(8) and rcorder(8).
Vivek, probably will not get executed at startup. But anyways, I'm intereted in having the filesystem mounted from fstab. That would mean that when the kernel loads iscsi_initiator module, to automatically see the /dev/daX device. Untill then, either cron or rc script :)