Tracking ubus listeners

Hi,

I have started on a large OpenWRT based support project.
I did a ubus uci commit command and certain services were restarted.
How do I track the listeners of a particular service ?
For example I changed the ssid of an AP then I did a ubus uci commit.
network services got restarted automatically, probably through listeners on the ubus.
How do I find out who has registered for a uci commit ?

Thanks.

Hi @maindoor,

  • One of the historical source for triggers is /etc/config/ucitrack where you will find a mapping
  • Then you have the procd_add_reload_trigger function which comes in the init.d scripts for services and allows to subscribe to changes on a resource (https://wiki.openwrt.org/inbox/procd-init-scripts). You should look for current examples in the code rather than take the content of that link as the gospel as I think it may be a bit out of date.

Note on the second one, it's the

/sbin/reload_config <config name>

that actually triggers the reload - "uci commit" is not enough.

By looking at these two, you should get a good feel for what is going to trigger on changes.

1 Like

I had a similar question, I believe currently there is no ubus command to list the services and subscribers. This will be helpful in knowing which modules are listening/interested in a particular resource. Is this statement correct?