Components
| Component | Description |
|---|---|
init | Runs as PID 1 during early boot, sets up the system |
procd | Service supervisor: starts, monitors, and restarts services |
udevtrigger | Replays udev events on boot to trigger hotplug |
upgraded | Handles sysupgrade coordination |
askfirst | Spawns a getty/shell on the console at first boot |
| Package | Description |
|---|---|
procd-ujail | Process jail helper using Linux namespaces |
procd-seccomp | Seccomp syscall filter support |
uxc | Container management using procd-ujail |
Service Script Structure
All init scripts live in/etc/init.d/ and use the /etc/rc.common framework:
procd_set_param Parameters
| Parameter | Description |
|---|---|
command | The command and arguments to execute |
env | Environment variable(s) to set |
respawn [threshold] [timeout] [retry] | Auto-restart settings. threshold: crash-free seconds before reset. timeout: seconds between restarts. retry: max restarts before giving up (0 = infinite). |
limits | Process resource limits (core, nofile, nproc, etc.) |
file | Config file(s) to watch; service restarts when these change |
netdev | Network interface to watch |
stdout | Redirect stdout to syslog (1=enable) |
stderr | Redirect stderr to syslog (1=enable) |
pidfile | Path to write the service PID |
user | Run the service as this user |
group | Run the service as this group |
START and STOP Values
START and STOP are integer ordering values (0–99). Services with lower START values start earlier. STOP is used for shutdown ordering.
Init Script Commands
procd via ubus
procd exposes aservice object on ubus for runtime service management:
Hotplug Subsystem
procd handles hotplug events (USB insertion, network link changes, etc.) by executing scripts from:<subsystem> matches the kernel’s hotplug subsystem name:
| Subsystem | Triggered by |
|---|---|
block | Block devices (USB storage, SD cards) |
net | Network interface changes |
usb | USB device insertion/removal |
button | GPIO button events |
ieee80211 | Wi-Fi radio events |
Available Hotplug Variables
| Variable | Description |
|---|---|
$ACTION | add, remove, change, bind, unbind |
$DEVNAME | Device name (e.g., sda1, eth1) |
$SUBSYSTEM | Kernel subsystem |
$DEVTYPE | Device type (e.g., disk, partition) |
Minimal Service Example
/etc/init.d/hello: