iscsid fails to log out from target on shutdown
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
open-iscsi (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Groovy |
Fix Released
|
Undecided
|
Unassigned |
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:/
[2]: https:/
[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://
--- original report ---
When using an iSCSI root filesystem, the /usr/share/
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/
An example of a minimal workaround may be seen at https:/
(Ubuntu 20.04)
Related branches
- Utkarsh Gupta (community): Approve
- Canonical Server packageset reviewers: Pending requested
- git-ubuntu developers: Pending requested
-
Diff: 36 lines (+14/-0)2 files modifieddebian/changelog (+7/-0)
debian/open-iscsi.finalrd (+7/-0)
- Dimitri John Ledkov (community): Approve (cheering on from the sideline)
- Utkarsh Gupta (community): Approve
- Canonical Server packageset reviewers: Pending requested
- git-ubuntu developers: Pending requested
-
Diff: 36 lines (+14/-0)2 files modifieddebian/changelog (+7/-0)
debian/open-iscsi.finalrd (+7/-0)
- Utkarsh Gupta (community): Approve
- Canonical Server packageset reviewers: Pending requested
- git-ubuntu developers: Pending requested
-
Diff: 36 lines (+14/-0)2 files modifieddebian/changelog (+7/-0)
debian/open-iscsi.finalrd (+7/-0)
description: | updated |
Changed in open-iscsi (Ubuntu Focal): | |
status: | New → Triaged |
Changed in open-iscsi (Ubuntu Groovy): | |
status: | New → Triaged |
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.