Home
[RDK Central Wiki]
CMF
[Code Releases]
We are developing an application that must be launched on startup immediately after the DHCP server has been initialised successfully. We explored the Utopia subcomponent of RDK-B and found that the DHCP server is run through the service_dhcp_server.sh script and not systemd. We were also successful in registering and launching a dummy service (/etc/utopia/registration.d/30_test_service + /etc/utopia/service.d/test_service.sh).
Powered by a free Atlassian Confluence Open Source Project License granted to RDKCentral. Evaluate Confluence today.
4 Comments
Unknown User (srinivas.k)
HI Nithin patet,
yes we can register our own service to run as soon as the particular service is initialized by using sysevents.
Sysevent utility will activate respective handlers upon events.
syntax:
sysevent async event_name $HANDLER
example:
sysevent async new_event_name /etc/utopia/service.d/new_service_handler.sh
sysevent async ethwan-initialized /etc/utopia/service.d/service_crond.sh
Note:
1. Register for $HANDLER to be activated whenever <event_name> changes value. Ensure that if multiple value changes occur, then only one instance of $HANDLER will be run at a time.
sysevent async event_name $HANDLER
2. Register for $HANDLER to be activated whenever any value is SET for <event_name>
sysevent async event_name $HANDLER
sysevent setoptions event_name $TUPLE_FLAG_EVENT
The files with numbers(15_dhcp_server) is used because there is a execute_dir programs will execute all files in the sysevent registration directory /etc/utopia/registration.d in lexicographic order. This is useful as the shell scripts should be called in certain order .
Thanks and Regards
Srinivas
Unknown User (nitin.patet)
Hi Srinivas,
Thanks for the suggestion!
sysevent async event_name $HANDLER would need to be executed on every reboot, right? If our service must be started as soon as DHCP server is up, is it better to use an executable in /etc/utopia/registration.d/?
Unknown User (srinivas.k)
HI Nitin Patet,
We can either execute on the console or we can add it in the code.
since you are invoking your application after dhcp is getting initialized, you can find a place in the code where the dhcp initialization is done successfully and then invoke your application
e.g,, get the dhcp_server_status and then invoke your application
sysevent get dhcp_server-status // started
sysevent async event_name $HANDLER
For your reference, you can refer the below files on how to use the sysevent async to invoke a service.
1. service_dhcp_server.sh
2. service_crond.sh
Thanks and Regards
Srinivas
Parthiban Subramanian
Hi All,
We are facing an issue that few ethernet lan clients when connected to cable modem box is not getting IP for example an windows client is getting IP but other client of same version of windows client is not able to get IP tried switching ports, factory rest etc, it is observed that the DHCP discover packet is not reaching the brlan0 interface. anyone faced this kind of issue or any pointers to debug it further below layers is much appreciated. Thanks