[LEDE-DEV] Lua script as a ubus service using rpcd

Karl Palsson karlp at tweak.net.au
Tue Dec 26 00:23:48 PST 2017


Carlito Nueno <carlitonueno at gmail.com> wrote:
> Hi all,
> 
> I am trying to make a ubus service in lua.
> 
> I placed a lua script (myluaservice) in /usr/libexec/rpcd but I
> didn't see it in ubus -v list.
> 
> So I placed a shell script (myshellservice) in
> /usr/libexec/rpcd and moved the lua script (myluaservice) to
> /usr/bin/ and made both scripts executables.
> 
> Now I can see the shell script in ubus -v list but lua script
> is not called.
> 
> Both scripts:
> https://gist.github.com/ironpillow/4e116a7aa897bf05b3bb39c38f9b23b4.
> 


How is rpcd meant to know that it needs to require your lua
module and call specific named functions?

You need to have the same arguments and invocation method as your
shell script, then it will work just fine.

Cheers,
Karl P
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.html
Type: application/pgp-signature
Size: 1161 bytes
Desc: OpenPGP Digital Signature
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20171226/8d8ef467/attachment.sig>


More information about the Lede-dev mailing list