A message system like D-Bus for Liminix, taken from OpenWRT's ubus
584f56a233
When the ubus "call" command fails, ubus prints "Command failed: ...". This is fine when the call command is executed interactively by the user. However, when the call command is executed non-interactively, these log messages leave the user completely clueless: netifd: wan6 (10841): Command failed: Unknown error procd: /etc/rc.d/S80umdns: Failed to parse message data These messages contain absolutely no info that explains where they come from; it's not even clear they are coming from ubus. This makes tracking down what's causing them virtually impossible. Improve this situation by printing the full ubus call to stderr when stderr is not a TTY. Example of improved error message: netifd: wan (2836): Command failed: ubus call network.interface notify_proto { "action": 0, "link-up": false, "keep": false, "interface": "wan" } (Permission denied) While one might argue not to include the JSON message in the log, excluding it will still not help to reproduce the failed command. As we only print the full command when stderr is not a TTY, seeing this error means we're doing a bad ubus call somewhere, which is a bug and should be fixed. Printing the full command makes more sense than printing half the command and still requiring us to figure out the exact command that failed. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be> Acked-by: Petr Štetiar <ynezz@true.cz> Acked-by: Jo-Philipp Wich <jo@mein.io> |
||
---|---|---|
examples | ||
lua | ||
tests | ||
.gitignore | ||
.gitlab-ci.yml | ||
cli.c | ||
CMakeLists.txt | ||
libubus-acl.c | ||
libubus-internal.h | ||
libubus-io.c | ||
libubus-obj.c | ||
libubus-req.c | ||
libubus-sub.c | ||
libubus.c | ||
libubus.h | ||
ubus_common.h | ||
ubusd.c | ||
ubusd.h | ||
ubusd_acl.c | ||
ubusd_acl.h | ||
ubusd_event.c | ||
ubusd_id.c | ||
ubusd_id.h | ||
ubusd_main.c | ||
ubusd_monitor.c | ||
ubusd_obj.c | ||
ubusd_obj.h | ||
ubusd_proto.c | ||
ubusmsg.h |