Write unhandled exceptions in invoked ucode method handlers to stderr in
order to simplify debugging failing scripts.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Ensure that the default module search path is initialized before compiling
ucode handler scripts in order to support compile time import statements.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
It makes little sense to execute rpcd ucode plugin scripts in template
mode since those scripts are supposed to output structured JSON data,
so change the parse config to compile scripts in raw mode.
Also initialize the default library search path which is required in
recent ucode versions.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
The public libucode api has been revised to return and expect an
uc_program_t pointer instead of a main function reference.
The program (former main function) is also not implicitly released
by uc_vm_execute() anymore.
Adjust the ucode plugin accordingly to match the new requirements.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
The rpcd ucode plugin allows utilizing ucode scripts to register ubus
objects and to implement the objects method callbacks.
Upon startup, rpcd will compile and execute each ucode script in
`$INSTALL_PREFIX/share/ucode/` and register ubus proxy objects and
methods definitions according to the signature returned by the script.
Refer to examples/ucode/example-plugin.uc for details of the signature
format.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>