OpenWrt Forum Archive

Topic: Looking information on creating UCI configuration modules

The content of this topic has been archived on 20 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I am new to OpenWRT and would like to play around a little bit with UCI and luci. What I would need at the moment would be a way to configure users for PPTPd.

My idea was to create a new UCI configuration "users" and generate a "chat-secrets" file from it.

The problem is that, although I found some information about UCI and LUCI in the wiki, I have no clue when to transform the configuration. It seems to me that at some point UCI "commits" the changes but then I would assume that some sort of "configurator" gets called which calls some scripts which allow one to act on the configuration changes.

I hope someone can give me an idea were to look or explain it in a few lines.

Thanks in advance

jens

When you save a UCI config via LuCI, LuCI calls a reload of the corresponding init script. This script is usually where UCI configuration translations occur. Check out the dnsmasq init script (/etc/init.d/dnsmasq) for a a very verbose example.

Basically you just:
1) Read the UCI config
2) Dump a service-specific config
3) Start/restart the service

To tell LuCI which init script to restart when you apply your changes, check out /etc/config/ucitrack. I believe the definitions are still done in there.

(Last edited by aport on 5 Jul 2012, 18:55)

Thnaks for your answer! I will have a look.

The discussion might have continued from here.