How to check the exposed services?

10 views
Skip to first unread message

Geevarghese V K

unread,
Jan 4, 2021, 1:09:58 PM1/4/21
to session-framework-dev
Dear team,

The main purpose of session manager is to launch the startup service and expose the services mentioned in session_manager.cml file.But i have few queries.

1) Where can i find this path ? 
/// The path to the configuration file for the session.
const CONFIG_PATH: &str = "/config/data/startup.config";

2) How to check whether the fidl services  are actually exposed?
pub async fn expose_services(&mut self) -> Result<(), Error> {
        let mut fs = ServiceFs::new_local();
        fs.dir("svc")
            .add_fidl_service(ExposedServices::ElementManager)
            .add_fidl_service(ExposedServices::Launcher)
            .add_fidl_service(ExposedServices::Restarter)
            .add_fidl_service(ExposedServices::InputDeviceRegistry);
        fs.take_and_serve_directory_handle()?;

Gabe Schine

unread,
Jan 5, 2021, 4:14:06 PM1/5/21
to Geevarghese V K, component-framework-dev, session-framework-dev

Hi Geevarghese,

Find answers inline.
 
1) Where can i find this path ? 
/// The path to the configuration file for the session.
const CONFIG_PATH: &str = "/config/data/startup.config";

This path is mapped to a configuration file mapped in at build-time. The component_manager (parent of session_manager) performs the mapping. At runtime, session_manager finds whatever file was mapped in at build-time at /config/data/startup.config. You can read more about config_data mapping here:


From there, you can probably find the BUILD.gn file that maps startup.config for session_manager. Let me know if you have any trouble.
 
2) How to check whether the fidl services  are actually exposed?
pub async fn expose_services(&mut self) -> Result<(), Error> {
        let mut fs = ServiceFs::new_local();
        fs.dir("svc")
            .add_fidl_service(ExposedServices::ElementManager)
            .add_fidl_service(ExposedServices::Launcher)
            .add_fidl_service(ExposedServices::Restarter)
            .add_fidl_service(ExposedServices::InputDeviceRegistry);
        fs.take_and_serve_directory_handle()?;

At runtime, you can inspect what services are exposed by a running component by looking at the "hub". You can read about the hub here:

 

--
All posts must follow the Fuchsia Code of Conduct https://fuchsia.dev/fuchsia-src/CODE_OF_CONDUCT or may be removed.
---
To unsubscribe from this group and stop receiving emails from it, send an email to session-framewor...@fuchsia.dev.

Yegor Pomortsev

unread,
Jan 5, 2021, 4:34:17 PM1/5/21
to Gabe Schine, Geevarghese V K, component-framework-dev, session-framework-dev
Re: #1, Session_manager is almost always configured through the session_config GN template, rather than using config_data directly.

It serves two purposes:
1. Store the given file in as /config/data/startup.config for component_manager_sfw, which offers the whole dir to session_manager.
2. Configure sysmgr to start component_manager_sfw/session_manager on boot.
Reply all
Reply to author
Forward
0 new messages