Writing a service for OpenWrt

How can I go about writing a daemon for openwrt and having it register with ubus? Are there any examples, is there any documentation at all?


Thanks. By the way, does the program I register with ubus HAVE to be a combiled binary, or can it be a, for example, lua script? I've come across some posts mentioning there's a lua module for ubus based on libubus as well, for the client side