On 26/12/2024 15:27, Chris Hofstaedtler wrote:
> On Wed, Dec 18, 2024 at 11:39:30AM +0100, Friedrich Weber wrote:
>> I'm seeing an issue where automatic login at boot doesn't work on trixie, and
>> even after manual login, automatic logout at shutdown doesn't work on some
>> setups (see below for details).
> 
> Does this happen only on systems upgraded from bookworm or also on
> fresh installs?

Automatic login seems broken both on systems upgraded from bookworm as
well as on fresh trixie installs, for slightly different reasons.

On a fresh trixie install:

- After the steps from my initial post, open-iscsi.service does not
start on boot, and hence doesn't autologin.
- The reason is that open-iscsi 2.1.10-2 doesn't put its discovery
records into /etc/iscsi/nodes/ anymore, hence the start conditions of
open-iscsi.service are not met.

On a bookworm install (with the iSCSI setup done before the upgrade to
trixie):

- With the steps from my initial post, automatic login works fine on
bookworm. open-iscsi 2.1.8-1 puts its discovery records into
/etc/iscsi/nodes/, and the start condition of open-iscsi.service checks
this location, so open-iscsi.service starts on boot and logs in.
- After upgrading to trixie and rebooting, automatic login doesn't work
anymore. Since /etc/iscsi/nodes/ still contains the pre-upgrade
discovery records, open-iscsi.service *does* start and runs
`/usr/sbin/iscsiadm -m node --loginall=automatic`. But open-iscsi
2.1.10-2 now keeps discovery records under /var/lib/iscsi/nodes instead
of /etc/iscsi/nodes, so it doesn't find any records and doesn't log in
to any targets.
- A workaround is to perform another discovery (`iscsiadm -m discovery
--type sendtargets --portal 10.1.1.128`). This puts new records into
/var/lib/iscsi/nodes. After a reboot, open-iscsi.service still starts
(because the leftover records in /etc/iscsi/nodes still exist), and now
open-iscsi finds the new records at /var/lib/iscsi/nodes. But once
someone removes /etc/iscsi/nodes/, the workaround stops working and we
get into the same situation as under a fresh trixie install.

>> - 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.

FWIW, that sounds sensible to me -- I also found an open-iscsi github
issue [1] that gives some more context on the move from /etc/iscsi/nodes
to /var/lib/iscsi/nodes.

Hope this helps!

Friedrich

[1] https://github.com/open-iscsi/open-iscsi/issues/308

Reply via email to