OpenWRT procd
What is procd
https://wiki.openwrt.org/doc/techref/procd
Table of Contents
What is procd?
procd
is the new OpenWrt process management daemon written in C. It keeps track of processes started from init scripts (via ubus calls), and can suppress redundant service start/restart requests when the config/environment has not changed.
procd
has replaced … , e.g.
-
hotplug2
, a dynamic device management subsystem for embedded systems. Hotplug2 is a trivial replacement of some of the UDev functionality in a tiny pack, intended for Linux early userspace: Init RAM FS and InitRD. -
busybox-klogd
andbusybox-syslogd
-
busybox-watchdog
procd
is intended to stay compatible with the existing format of /etc/config/
; exceptions …
Help with the development of procd
-
test what has been ported
-
review of the code
Buttons with procd
see commit in https://dev.openwrt.org/log/trunk/package/base-files/files/etc/rc.button
see use case hardware.button
Init scripts with procd
Why do we want procd?
One thing that procd
does much better then …
It boils down to the fact that the current … are rather constrained and inflexible:
-
…
-
…
-
…
procd
will be able to … - and of course all that without adding unnecessary bloat. AFAIK there are no alternatives to procd.
procd (process management daemon) – Technical Reference
-
procd is available in OpenWrt since r34865 (trunk). It consists of files under GPLv2, LGPLv2.1 and ISC licenses.
OpenWrt – operating system architecture
Whereas desktop distributions use glib and dbus (and udev) OpenWrt uses libubox and ubus (and hotplug2). This provides some pretty awesome functionality without requiring huge libraries with huge dependencies (*cough* glib).
Desktop Distributions | OpenWrt | Android | Replicant | mer-based | |||
---|---|---|---|---|---|---|---|
Typical main memory size | 128 MiB to 16 GiB (or more) | 32 MiB to 512 MiB1) | min 92 MiB for Android 2.1 min 340 MiB for Android 4.0 |
? | |||
Supported instruction sets | almost anything | almost anything | x86, 86-64, ARM, MIPS32 | ||||
non-volatile storage space | 100 MiB | 8 MiB2) | 150MiB for Android 2.1 512MiB for Android 4.0 |
? | |||
kernel | Linux kernel |
||||||
FOSS and binary drivers | FOSS drivers: e.g. 802.11; Iaccess | Android binary drivers | |||||
C standard library | glibc | uClibc | bionic | glibc + libhybris | eglibc 2.15 | ||
init | init Upstart Initng |
systemd |
busybox-initd | procd |
Android init-fork | systemd |
|
rsyslog / syslog-ng | busybox-klogd, busybox-syslogd | ||||||
watchdog | busybox-watchdog | ||||||
udev | hotplug2 | ubox? | |||||
cron | busybox-crond |
||||||
atd | na | ||||||
D-Bus | ubus | Binder | ? | D-Bus | |||
network configuration | NetworkManager + GUI | netifd |
ConnectivityManager (not ConnMan = ConnectionManager!) |
? | ConnMan | ||
GLib (GObject, Glib, GModule, GThread, GIO) |
libubox | ? | ? | Qt-based? | |||
PulseAudio | PulseAudio (optional) | PulseAudio | PulseAudio | PulseAudio | |||
Package management system | dpkg/APT RPM/yum portage pacman … |
opkg |
apk | ? | RPM |
Dependencies of LuCI2
The idea for LuCI2 and its different components started a long time ago: http://luci.subsignal.org/trac/browser/luci2; Code is being developed here;
-
libubox
(~ 12KiB) is a general purpose library which provides things like an event loop, binary blob message formatting and handling, the Linux linked list implementation, and some JSON helpers. The functions inlibubox
are used to write the other software in LuCI2 -
ubus
(~ 13KiB) is an RPC daemon similar to D-Bus but with a much friendlier C API
-
PulseAudio does not depend on GLib and does not seem to depends on D-Bus neither: LFS
What's the difference between ubus and dbus?
dbus
is bloated, its C API is very annoying to use and requires writing large amounts of boilerplate code. In fact, the pure C API is so annoying that its own API documentation states: "If you use this low-level API directly, you're signing up for some pain."
ubus
is tiny and has the advantage of being easy to use from regular C code, as well as automatically making all exported API functionality also available to shell scripts with no extra effort.
"Of course, NetworkManager should be renamed to "unetwork"
, dbus to "ubus"
, PulseAudio to "usound"
, and X.Org-Server/Wayland-Compositor to "udisplay"
; and then indescribable happiness would come down to all people of this world." – Lennart Poettering
History
Package history is available at:
-
current history: https://dev.openwrt.org/log/trunk/package/system/procd
-
old history pre r37007 https://dev.openwrt.org/log/trunk/package/procd/Makefile?rev=36995