[luci] [dev] luci config reload and services

Steven Barth steven at midlink.org
Wed Feb 18 12:42:44 CET 2009


Hello,

> The problem is that I still want to be able to change the rsync service
> settings but when I change them, the luci call back first checks if the
> service is enabled and dies if not. So the /etc/config/rsync file is well
> updated but it does not trigger a /etc/init.d/rsync reload for me to update
> files like a /etc/rsyncd.conf.
You could write an excutable script like "/etc/reload-rsync" that does the 
work of rewriting the config-file and add an 
option exec '/etc/reload-rsync'
instead of
option init 'rsync'
to ucitrack. The enabled check for init.d is there because we don't want to 
start any disabled services when the user changes its configuration.

>
> Is there a better way to implement what I want ? Should I modify some
> templates ? I could not find the right documentation or howto especially
> about the links between the luci web interface and config files triggering.
When you hit: "Save & Apply" or "Apply" anywhere the function 
luci.model.uci.apply() is called, reads ucitrack and calls /sbin/luci-reload 
with the appropriate parameters.

> By the way, what is the effect of the "list affects" keyword in the
> ucitrack file ?
This will trigger additional applying tasks to be done after the given task.
E.g. 
list affects dhcp 
in the network section will cause the dhcp-server to be reloaded everytime the 
network configuration is reloaded.

Cheers
Cyrus




More information about the luci mailing list