LuCI APP: luci-app-chrony

Hi,

This provides a web UI for the "chrony" NTP package, which is an alternative full NTP implementation. There are 2 pages/tabs added to System; "Time NTP setup (chrony)" and "Time monitor (chrony)".

Like many others, this is my first attempt at a package for OpenWRT and LuCI. So...

  • The feed setup instructions may not be completely correct, I'll take help, advice.
  • The install adds a 'service_triggers()' function to the chronyd init script. This is needed to trigger a restart of chronyd when changes to setup are applied. Eventually I will propose a patch to the main chrony package, this is the correct thing to do.
  • The UCI config file design in the main chrony config is used as is. But, this does not lead to a clean model/cbi page. The whole config/init-script/luci-model-cbi should be looked at for a cleaner approach.
  • I would like to combine the 2 pages I created into a single screen with 2 folder tabs, and a single entry point off the System menu. I'm new to this, I need first to learn how to do this.
  • I have tested everything quite a lot, but if you have problems please let me know.

Thank you. Rick.

3 Likes

I like what you are doing.
I was trying to make it work but no success. I'm running OpenWrt 19.07.3 r11063-85e04e9f46 / LuCI openwrt-19.07 branch git-20.247.75781-0d0ab01.

on the Setup Tab it throws this error:

/usr/lib/lua/luci/dispatcher.lua:1334: module 'luci.cbi' not found:
	no field package.preload['luci.cbi']
	no file './luci/cbi.lua'
	no file '/usr/share/lua/luci/cbi.lua'
	no file '/usr/share/lua/luci/cbi/init.lua'
	no file '/usr/lib/lua/luci/cbi.lua'
	no file '/usr/lib/lua/luci/cbi/init.lua'
	no file './luci/cbi.so'
	no file '/usr/lib/lua/luci/cbi.so'
	no file '/usr/lib/lua/loadall.so'
	no file './luci.so'
	no file '/usr/lib/lua/luci.so'
	no file '/usr/lib/lua/loadall.so'
stack traceback:
	[C]: in function 'require'
	/usr/lib/lua/luci/dispatcher.lua:1334: in function '_cbi'
	/usr/lib/lua/luci/dispatcher.lua:1023: in function 'dispatch'
	/usr/lib/lua/luci/dispatcher.lua:478: in function </usr/lib/lua/luci/dispatcher.lua:477>