Services Management
Relevant source files
The following files were used as context for generating this wiki page:
Services Management in LuCI Mobile allows users to control and configure background daemons and network utilities running on an OpenWrt router. The application provides a mobile interface to start, stop, and restart services, while managing specific configurations for common OpenWrt modules such as Dynamic DNS (DDNS), Smart Queue Management (SQM), and Adblock.
The system interacts with the router via LuCI RPC to modify Unified Configuration Interface (UCI) files and trigger service actions. It utilizes a safe "apply-with-rollback" protocol to ensure that configuration changes do not permanently disconnect the user if a network failure occurs during the update.
Sources: README.md:19-21, README.md:23-28, fastlane/metadata/android/en-US/full_description.txt:18-18
Supported Services
LuCI Mobile manages several core networking and system services. The following table details the primary services identifiable through the application's configuration mocks and documentation.
| Service Name | Description | Key Configuration Parameters |
|---|---|---|
| DDNS | Dynamic DNS update client for maintaining hostname-to-IP mapping. | lookup_host, domain, username, password, interface |
| SQM | Smart Queue Management for network traffic shaping and latency control. | Service state (Start/Stop/Restart) |
| Adblock | Network-wide advertisement and tracker blocking. | Service state (Start/Stop/Restart) |
| UPnP | Universal Plug and Play for automated port mapping. | Service state (Start/Stop/Restart) |
| DHCP/DNS | Address assignment and name resolution via dnsmasq/odhcpd. | domain, leasefile, leasetime, start, limit |
| NTP | Time synchronization via Network Time Protocol. | enabled, server list |
Sources: README.md:19-19, assets/mock/uci_ddns.json:6-12, assets/mock/uci_dhcp.json:2-15, assets/mock/uci_system.json:16-25
Service Configuration Architecture
The application manages services by manipulating UCI (Unified Configuration Interface) sections. Each service typically contains a "global" configuration section and one or more "service" or "instance" sections that define specific behaviors.
Dynamic DNS (DDNS) Structure
DDNS configuration consists of a global settings block and specific service definitions for different providers or IP versions (IPv4/IPv6).
The diagram shows the relationship between global DDNS settings and individual service instances.
Sources: assets/mock/uci_ddns.json:2-13
DHCP and DNS Services
The system manages address allocation and name resolution through dnsmasq and odhcpd UCI sections. These define how the router handles client requests on specific interfaces like the LAN.
This flowchart represents the configuration hierarchy for DHCP services as defined in the router's UCI.
Sources: assets/mock/uci_dhcp.json:2-42
Service Control Flow
When you initiate a service action (Start, Stop, or Restart), the application follows a specific communication sequence with the router's RPC backend.
The sequence diagram illustrates the flow from a user action in the mobile app to the execution of a service command on the router.
Sources: README.md:23-28, fastlane/metadata/android/en-US/full_description.txt:30-30
Configuration Management
Service configurations are modified by updating specific UCI fields. Below are examples of how service data is structured within the system.
System Time (NTP) Configuration
The system clock service is managed through the system UCI configuration.
"ntp": {
".type": "timeserver",
"enabled": "1",
"enable_server": "0",
"server": [
"0.openwrt.pool.ntp.org",
"1.openwrt.pool.ntp.org"
]
}
Sources: assets/mock/uci_system.json:16-25
Firewall Rules for Services
Some services require specific firewall rules to function or to implement blocks requested by the user. For instance, the application can generate rules to block specific MAC addresses.
"luci_mobile_block_ccddee98765a": {
".type": "rule",
"name": "Block Baby-Monitor (LuCI Mobile)",
"src": "lan",
"src_mac": "CC:DD:EE:98:76:54",
"target": "REJECT",
"enabled": "1"
}
Sources: assets/mock/uci_firewall.json:44-52
Summary
Services Management provides a centralized interface for controlling the operational state and configuration of OpenWrt network utilities. By leveraging UCI-based configuration files and RPC-driven service actions, LuCI Mobile enables users to maintain dynamic DNS settings, manage traffic shaping via SQM, and ensure network security through ad-blocking and firewall integration. The use of an apply-with-rollback protocol ensures high reliability during remote service reconfigurations.
Sources: README.md:19-21, fastlane/metadata/android/en-US/full_description.txt:18-18