ubus is OpenWrt’s inter-process communication (IPC) framework. It provides a lightweight message bus over Unix domain sockets, allowing daemons and system components to expose services and communicate without direct dependencies on each other.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/openwrt/openwrt/llms.txt
Use this file to discover all available pages before exploring further.
Architecture
ubus consists of two main components:| Component | Package | Description |
|---|---|---|
ubusd | ubusd | The central broker daemon. All IPC traffic passes through it. Runs as the ubus user (UID 81). |
libubus | libubus | Client library for C programs. Provides the API to connect, register objects, and invoke methods. |
ubus | ubus | Command-line utility to interact with the bus. |
libubus-lua | libubus-lua | Lua bindings for libubus. |
ubusd listens on a Unix socket (by default /var/run/ubus/ubus.sock) and routes messages between connected clients.
Object and Method Model
ubus uses an object/method model:- A daemon registers one or more named objects on the bus (e.g.,
system,network.interface.lan). - Each object exposes a set of named methods with typed input/output parameters.
- Other processes call those methods or subscribe to event notifications.
libubox).
CLI Reference
List Objects
Call Methods
Events
Wait for Object
Usage Examples
Get Board Information
Get Interface Status
List Running Services
Writing a ubus Client in Shell
Shell scripts can use theubus CLI with JSON output parsed by jsonfilter (from the jsonfilter package):
Writing a ubus Client in C
A minimal C client usinglibubus:
The ubus socket path defaults to
/var/run/ubus/ubus.sock. Earlier OpenWrt versions used /var/run/ubus.sock. Pass the path explicitly with ubus -s <path> if needed.