[Bug 1922976] Re: iscsid fails to log out from target on shutdown

Christian Ehrhardt  1922976 at bugs.launchpad.net
Wed Apr 14 07:22:02 UTC 2021


Thanks for the answers Michael!


With Focal in my test environment I still see
Unexpected iSCSI Connection State, forcing iSCSI logout.
Logging out of session [sid: 1, target: tgt-boot-test-CgkE2Y, portal: 10.0.12.2,3260]
[ 1291.109263] sd-execu[1616]: /usr/lib/systemd/system-shutdown/open-iscsi.finalrd failed with exit status 141.
[ 1291.114839] reboot: System halted
=> But TBH, that also is at a ~25s delay :-

So I might need a different setup to test this myself.

I looked at the changes more in detail:

#1
NSS while not directly linked (and thereby missed by:
  copy_exec /sbin/iscsid
Can be needed by nsswitch.conf used by getpwuid of glibc and 
the default being "files" which then needs this lib eventually.

#2
And a fake trivial passwd, I can't see how that hurts and it if fixes the issue that you are seeing - why not adding that.


I've thrown preliminary builds for Hirsute and Focal adopting your
changes into a PPA [1] and would appreciate if you could test if they
indeed work out as you expect.

[1]: https://launchpad.net/~ci-train-ppa-
service/+archive/ubuntu/4527/+packages

-- 
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:
  Triaged

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)

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