Comment 4 for bug 1802354

Revision history for this message
Scott Moser (smoser) wrote : Re: [Bug 1802354] Re: iscsid does not run if there are only initramfs initiated targets

@Steve,

That feels overly indirect.
If open-iscsi.service (or anything) knows that iscsid should be running,
then why be sly?

Thats essentially what we were trying to do, and in some cases it didn't
work. Starting a persistent daemon by requesting to list the current
sessions seems like an arbitrary side-effect.

fwiw, in my testing here 'iscsiadm -m session -s' ends up connecting to
the socket (thus starting the service) and writing:
  iscsiadm: Could not execute operation on all sessions: session not found
and then exiting 2.
That is all working "as designed".

If we want to start the service, or make sure that its running. It seems
better just to start the service. If we want to do that by the indirect
mechanism of connecting to a socket, then I suggest we do *that* directly
like in 'connect-abstract-socket.py':

  #!/usr/bin/python3
  from socket import socket, AF_UNIX, SOCK_STREAM
  import sys
  name = "ISCSIADM_ABSTRACT_NAMESPACE" if len(sys.argv) < 2 else sys.argv[1]
  print("Connecting to @%s" % name)
  socket(AF_UNIX, SOCK_STREAM).connect(('\0' + name))
  print("Connected to @%s" % name)
On Thu, Nov 8, 2018 at 6:20 PM Steve Langasek
<email address hidden> wrote:
>
> Instead of manually invoking systemctl here which seems like an
> abstraction violation to me, I would suggest that open-iscsi.service
> should issue an iscsiadm command that talks to the socket and triggers
> the daemon to be started.
>
> In effect, '/sbin/iscsiadm -m node --loginall=automatic' already does
> this but only for the case that /etc/iscsi/nodes is non-empty.
>
> I would suggest 'iscsiadm -m session -s'.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1802354
>
> Title:
> iscsid does not run if there are only initramfs initiated targets
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/open-iscsi/+bug/1802354/+subscriptions