[DRAFT] service: add autostart option#265
[DRAFT] service: add autostart option#265jdiez17 wants to merge 1 commit intoFedericoPonzi:masterfrom
Conversation
|
Thanks for the pr! Can you please also update the documentation and the sample service? https://github.com/FedericoPonzi/Horust/blob/master/horust/example_services/sample_service.toml |
|
I will update the docs and example service and add a test for autostart=false.
I have implemented a custom "RPC" handler for this. See https://github.com/raccoon-os/rccn_userspace_ws/blob/launch_service/src/rccn_usr_launch/src/launch_service/service.rs#L51-L63 |
e9f47d7 to
0222c55
Compare
Motivation and Context
This PR adds an option to autostart services (set to true by default).
We need this in our application to designate services that should not be started by default, only by command.
Description
The change is quite simple:
Repo::is_service_runnable()now also checks ifservice.autostartistrue, otherwise it doesn't start it.I'm not sure that I like the the name
Repo::is_service_runnable()(as the service is in fact runnable, but we choose not to run it), or the fact that the service stays in theInitialstate whenautostartis false and the service is not running.Your thoughts would be welcome here.
How Has This Been Tested?
Works on my computer ™️
Let me know if you have some thoughts on how to test it.
Types of changes
Checklist: