Routing of Services

I have developed several applications intended to run on a simple system. All these applications are managed as part of a launchpad so that the user can select which one to run. However, I encountered an issue with routing. For example, my application requires a terminal service, which I defined in the launchpad configuration like this:

<start name="qt5_launcher" caps="5000">
  <config>
    <launcher name="browser" ram_quota="100M">
      ...
    </launcher>
  </config>

  <route>
    ...
    <service name="Terminal">
      <child name="jitter_sponge"/>
    </service>
    ...
  </route>
</start>

But I get the following error:

Error: Terminal-session creation failed (label="", ram_quota=10K, caps=3, )

Additionally, I am facing an issue with routing in the following structure:

driver -> network
launchpad -> app

I need to use a service from the network component inside the app application. However, I have not been able to achieve this.

I’m just guessing: It looks like your qt5_launcher component is somewhat based on the qt5_launchpad example of the libports repository, which in turn is roughly based on the launchpad example of the demo repository, which has the child-management code factored out as the “launchpad” library. The launchpad library is fairly ancient and not very flexible. In particular, its routing policy is hard-wired in the code. Note that the “Terminal” is notably absent from the list. In short term, you may solve your routing error by extending the list.

In situations where you need to manage children with full control and flexibility, the sandbox library is a much better choice today. It exposes the full feature set of init as a library.

Regarding your last question of accessing a service hosted in a subsystem (presuming “driver” is an init instance), you need to use init’s service-forwarding mechanism. For an example, you may look at how Sculpt’s drivers subsystem makes the “Platform” service available to the outside world.

1 Like