[Bug 1922976] Re: iscsid fails to log out from target on shutdown
Christian Ehrhardt
1922976 at bugs.launchpad.net
Fri Apr 16 06:12:52 UTC 2021
Hirsute done, sponsored as SRUs for Focal and Hirsute for review by the
SRU Team
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to open-iscsi in Ubuntu.
https://bugs.launchpad.net/bugs/1922976
Title:
iscsid fails to log out from target on shutdown
Status in open-iscsi package in Ubuntu:
Fix Released
Status in open-iscsi source package in Focal:
Triaged
Status in open-iscsi source package in Groovy:
Triaged
Bug description:
[Impact]
* The finalrd hook [1] of openiscsi runs iscsid which wants to
check for users [2] of its IPC peers. That fails for issues
with nss in that environment.
* The changes prep nss (libs) and if necesary fake a trivial
/etc/passwd so that the code runs as expected
* This avoids a delay or hang when running that code
[1]: https://git.launchpad.net/ubuntu/+source/open-iscsi/tree/debian/open-iscsi.finalrd?h=ubuntu/hirsute-devel
[2]: https://git.launchpad.net/ubuntu/+source/open-iscsi/tree/usr/mgmt_ipc.c?h=ubuntu/hirsute-devel#n371
[Test Plan]
* Set up iscsi root and then shut-down the system
* Check for errors or delay on the final cleanup which is here
this code runs.
[Where problems could occur]
* Since the only thin the update touches is the finalrd hook
there are two places to look out for
a) finalrd generation which means look for finalrd.service
b) shutdown of a system (as this is when systemd-shutdown pivots into
this environment)
[Other Info]
* nss is in use very indirectly here from getpwuid in glibc via nssswicth
config into the default value "file" to the lib
* if unaware it might be worth to have a look at finalrd itself
http://manpages.ubuntu.com/manpages/focal/man1/finalrd.1.html
--- original report ---
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)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/open-iscsi/+bug/1922976/+subscriptions
More information about the foundations-bugs
mailing list