On 04/26/2017 01:11 AM, Gris Ge wrote:
>     B) Expand iscsid to listen on a socket for IPC with JSON output.
>         Pro:
>             * Easy to create language bindings via JSON + IPC.
>         Con:
>             * More code work on iscsid like lock, ipc listener, json
>               formatter and etc.

I don't think creating yet another own IPC interface is a good
idea, there are already way too many IPC protocols in the Linux
plubming space. I believe that DBus would be the obvious choice
here. This has several advantages:

 - introspection support
 - the object-based view it provides lends itself well to the
   problem at hand
 - a _lot_ of tooling
 - lots of language bindings
 - support for notifications (signals): this allows iscsid to
   broadcast changes to anyone who's interested
 - authorization can be managed entirely via PolicyKit, so
   there's no need t invent an own authentication and
   authentication system, one can leverage something that many
   people are already used to

There are some caveats though:

 - the DBus daemon might not have been started at the point
   where iscsid is started

 - the DBus daemon might be stopped before iscsid is suppoed
   to stop, so the DBus connection could go away at any time

However, I think both of these issues are solvable:

 1. If the DBus connection can't be established at startup,
    don't consider that to be a failure, just continue on.

 2. Upon receiving SIGUSR1 (or similar), try to reconnect to
    the system bus. iscsid could be sent SIGUSR1 from a
    service file / init script after DBus is up and running

 3. If the system bus connection goes away, don't fail, just
    continue on. Maybe try to reconnect immediately once, in
    case someone just restarted the daemon.

Regards,
Christian

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to