[...] >>> What do you think is missing upstream so that starting Jami is >>> simpler? >> >> 1) Lack of D-Bus support in Shepherd to easily start D-Bus services. >> The upstream systemd service definition for the Jami daemon (jamid) is >> this: >> >> # net.jami.daemon.service >> [D-BUS Service] >> Name=cx.ring.Ring >> Exec=@LIBDIR@/jamid >> >> But that's nearly not where the complexity of our jami-service-type >> lies. > > But that should be fine: we have dozens of D-Bus services that happily > get started by dbus-daemon. I guess that works (minus races like we've had with elogind) if the other services are also D-Bus services sharing the same bus. But here the code talking with Jami are in the Shepherd service actions and more critically in the start slot itself -- so it's important the D-Bus service has been acquired and ready to service D-Bus calls otherwise they'd fail (that's what the loop polling for (jami-service-available?) ensures). >> Rather, it's in the following: >> >> 2) The lack of a way to declaratively configure Jami and the need to use >> D-Bus API to issue commands to Jami non-interactively. For example, to >> have Jami import an account it's necessary to go via either >> >> a) the GUI or >> b) the D-Bus API >> >> The Jami service in Guix makes use of b), which introduces the need for >> some Scheme bindings wrapping the low-level D-Bus interface. Perhaps >> such bindings could live in Jami itself. >> >> The second point (2) could be addressed upstream, but since it's a >> rather niche use case (the common use case is simply running the client >> GUI), is already achievable via D-Bus, and would probably require a >> considerable amount of work in Jami itself, I think we can keep it as is >> for now, as a Guix System exclusive feature ;-). Note that even if Jami >> could be configured via configuration files, we'd still want to be able >> to communicate with it via D-Bus to maintain the possible actions >> currently available in our Shepherd service (listing/enabling/disable >> accounts, etc.), so it'd only really help to reduce the start slot, and >> that's it. We'd still need most of the D-Bus bindings, so it wouldn't >> help that much anyway. > > Ah I see. > >> I hope that clarifies how our jami-service-type is both complex but also >> unique. > > Sure, the ability to configure Jami in a declarative and stateless > fashion is a plus, that’s really cool. > > Longer-term I think this should go in Jami proper though. It’s great > that Guix has an edge over the competition :-), but having to maintain > it is less nice. Perhaps with the Scheme bindings introduced by Olivier for the Jami tests (that work via an embedded libguile), it could be possible to add the ability to pass an init script to 'jamid' at launch time, which would automate importing the account. Proper 'Scheme' bindings would be nice though, and I'd like to look into the feasibility to add these via Swig. Food for thought. > Also, in more concrete terms: one goal of the least-authority work at > is to remove > ‘make-forkexec-constructor/container’ and the whole (gnu build shepherd) > module. Jami is one of its last remaining users (adjusting it felt like > beyond my abilities, precisely because it’s much more complex than the > other services I adjusted). > > Could you take a look at that eventually, once this patch has been > reviewed? I reviewed how that works, and it'd be easy; I just didn't see the incentive yet (there's no composition needed for the service, and it'd make the definition slightly less readable). If you tell me mark+forkexec-constructor/container is going the way of the Dodo though, that's a good enough incentive :-). Thanks for having a look! Maxim