Subject: Delay after iscsid exits?

From: Paul Suh <[email-masked]>
Date: Fri, 4 Dec 2020 02:47:50 +0000

Folks, 

Long-time user, first time posting to the list. 

I’m using iscsid on Alpine Linux as an initiator to an ISCI target. The connection works all well and good. I can manually run iscsid and connect, then mount the target and use it like any other disk. 

To make it work at boot time, I put the mount point into /etc/fstab with a mount option of _netdev, and added iscsid to the rc_need section in /etc/conf.d/netmount

This should cause netmount to wait until after iscsid finishes before it tries to mount the target. However, it turns out that iscsid returns before it finishes creating the devices in /dev, so netmount fails to mount the iscsi target. 

I wrote a little additional open-rc service script that checks /dev to see if the iscsi devices have been created and loops until they are created or it reaches a timeout, and set netmount to depend on the new service script. It works, but there must be a better way. 

Is there something else out there that I missed that would delay netmount until after the devices are created by iscsid? Or some other way to mount the iscsi targets rather than using fstab? 

Thanks! 

—Paul