Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run servicemanager in non android OS #91

Open
ya1gaurav opened this issue Feb 1, 2022 · 2 comments
Open

How to run servicemanager in non android OS #91

ya1gaurav opened this issue Feb 1, 2022 · 2 comments
Labels
question Further information is requested

Comments

@ya1gaurav
Copy link

In case of android, servicemanager run as separate service during boot.
In case of non android OS, how to run service manager using libgbinder?

@ya1gaurav ya1gaurav changed the title How to run servicemanger in non android OS How to run servicemanager in non android OS Feb 1, 2022
@monich monich added the question Further information is requested label Feb 1, 2022
@monich
Copy link
Collaborator

monich commented Feb 1, 2022

If no one is running a service manager for you, you would have to do it yourself. Unit tests contain a few very primitive implementations of various servicemanager binder APIs, like this one for example. Those would give you a very rough idea how it could be done with libgbinder. It's not that hard, really, especially the early simple servicemanager APIs like the one called "aidl" in libgbinder.

Writing a real servicemanager (e.g. the one accessible via zero handle) would require a few changes in libgbinder, at least to provide an equivalent of ProcessState::becomeContextManager and keep an internal reference to the local servicemanager object (no more than one per binder device). AFAICT becoming the context manager is a one-way thing, i.e. there's no way to stop being the context manager.

I can imagine a function like gbinder_local_object_become_context_manager() being added to libgbinder API if that's really going to be useful to somebody.

@ya1gaurav
Copy link
Author

ya1gaurav commented Feb 2, 2022

If no one is running a service manager for you, you would have to do it yourself. Unit tests contain a few very primitive implementations of various servicemanager binder APIs, like this one for example. Those would give you a very rough idea how it could be done with libgbinder. It's not that hard, really, especially the early simple servicemanager APIs like the one called "aidl" in libgbinder.

Writing a real servicemanager (e.g. the one accessible via zero handle) would require a few changes in libgbinder, at least to provide an equivalent of ProcessState::becomeContextManager and keep an internal reference to the local servicemanager object (no more than one per binder device). AFAICT becoming the context manager is a one-way thing, i.e. there's no way to stop being the context manager.

I can imagine a function like gbinder_local_object_become_context_manager() being added to libgbinder API if that's really going to be useful to somebody.

This would be helpful.
A service (systemd service daemon) could be created which will become context manager & the service could be launched on bootup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants