On Wed, Dec 18, 2024 at 11:39:30AM +0100, Friedrich Weber wrote:
> I believe the reason is that upstream open-iscsi 2.1.9 changed [1] the 
> location
> of the persistent discovery database from /etc/iscsi/nodes to
> /var/lib/iscsi/nodes:
> 
> # ls -al /etc/iscsi/nodes
> ls: cannot access '/etc/iscsi/nodes': No such file or directory
> # ls -al /var/lib/iscsi/nodes
> total 12
> drwx------ 3 root root 4096 Dec 18 09:22 .
> drwx------ 4 root root 4096 Dec 18 09:22 ..
> drwx------ 3 root root 4096 Dec 18 09:22 
> iqn.2003-01.org.linux-iscsi.iscsi-target-1path.x8664:sn.a65a5f75b209
> 
> But open-iscsi.service [2] checks for existence of /etc/iscsi/nodes (or
> /sys/class/iscsi_session, which doesn't exist if there is no iSCSI session):
> 
> # systemctl cat open-iscsi.service | grep Condition
> ConditionDirectoryNotEmpty=|/etc/iscsi/nodes
> ConditionDirectoryNotEmpty=|/sys/class/iscsi_session
> 
> And hence doesn't start on boot.

[..]

> If I manually override ConditionDirectoryNotEmpty, both automatic login and
> logout seem to work again:
> 
> # cat /etc/systemd/system/open-iscsi.service.d/override.conf
> [Unit]
> ConditionDirectoryNotEmpty=|/var/lib/iscsi/nodes
> 
> There is likely an additional problem on upgrades: On setups using automatic
> login on bookworm, automatic login won't work after upgrading to trixie. These
> setups have records at /etc/iscsi/nodes, so current open-iscsi.service will
> start, but iscsiadm will not find them and thus won't log in.

[..]

> - change open-iscsi.service to use the new location, i.e.,
>   ConditionDirectoryNotEmpty=|/var/lib/iscsi/nodes.
> 
>   But this would still break automatic login on setups upgrading from bookworm
>   that have records in /etc/iscsi/nodes, as post-upgrade open-iscsi.service
>   won't start on boot then. Even if it started, iscsiadm wouldn't find the
>   discovery records under the old location and wouldn't login (see above).

I'd be in favor of doing this, and have the postinst do a one time
`mv` from /etc/iscsi/nodes to /var/lib/iscsi/nodes.

What do people think?

Chris

Reply via email to