How makes uci commit work to reload service?

Hi All,

I'm trying to create a service/daemon, which read uci config as default setting.
I would like to reload service when /etc/config/videod was changed.
I add following code into my init script.

+ reload_service() {
+     ubus call videod reload
+ }
+ 
+ service_triggers() {
+     procd_add_reload_trigger "videod"
+ }

I reboot system and do "uci set videod.xxxx.yyyy=zzz" and "uci commit videod".
But nothing happen. Which part I'm wrong? Please help. Thanks.

First, you don't need to reboot your system to take changes to init.d into account. Just restart that service.

Then, I think you're just missing the reload command after the commit.

/sbin/reload_config

see here: https://openwrt.org/docs/guide-user/base-system/uci#examples
and here: https://openwrt.org/docs/guide-developer/procd-init-scripts#procd_triggers_on_config_filenetwork_interface_changes

1 Like

Hi VincentR,

Thanks. After apply reload_config, anything works good. Thanks.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.