iscsid fails to log out from target on shutdown

Bug #1922976 reported by Michael Brown on 2021-04-07
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
open-iscsi (Ubuntu)
Undecided
Unassigned

Bug Description

When using an iSCSI root filesystem, the /usr/share/finalrd/open-iscsi.finalrd script runs an instance of iscsid, waits for iscsid to find the existing logged-in sessions, and then logs out from the iSCSI target.

This currently fails because iscsid happens to call getpwuid() on UID 0. Within the finalrd there are no libnss_*.so libraries and no /etc/passwd file, so the getpwuid() call returns NULL. This causes iscsid to report an error "peeruser_unix: unknown local user with uid 0", and prevents iscsid from recovering the existent session. The end result is that the open-iscsi.finalrd script waits for its maximum 30 seconds and then fails to log out from the iSCSI target.

The error message is most easily observed by modifying /usr/share/finalrd/open-iscsi.finalrd to run iscsid as "iscsid -f -d 8".

An example of a minimal workaround may be seen at https://github.com/ipxe/sanbootable/commit/30bc58ce013a4db6b6d3480e42d4dc42d927fc5f

(Ubuntu 20.04)

Paride Legovini (paride) wrote :

Hello Michael and thanks for this bug report. I don't have a system I can reproduce the issue on at the moment, but your analysis looks correct to me. Integrating your open-iscsi-sanbootable.finalrd into the open-iscsi.finalrd hook shipped with the open-iscsi Ubuntu package should do the trick.

The open-iscsi.finalrd hook is an Ubuntu-specific thing, so there is no doubt the fix belongs to Ubuntu.

Here I think we need to:
 - Prepare a open-iscsi package with an updated open-iscsi.finalrd
 - Verify that is works and causes no regressions (ideally with your help)

Cc: xnox, maintainer of the finalrd and original author of the open-iscsi.finalrd hook, just in case se has thoughts on this issue or on the inclusion of libnss in the finalrd.

Changed in open-iscsi (Ubuntu):
status: New → Triaged
tags: added: server-next
Michael Brown (mcb30) wrote :

Thanks. I can easily retest whenever an updated open-iscsi .deb is available to download - just let me know.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers