Expand description
What the watch needs from the running machine, as pure functions where it
can be (tested), reading /etc, /sys and /proc only in read_*.
Functions§
- boottime_
secs - CLOCK_BOOTTIME whole seconds: the integer part of
/proc/uptime. - expand_
tools - The network tools now: plain names as they are, a template (
name@) as each running instance (name@inst) amongrunning. - network_
tools - The export’s top-level
networkTools(/etc/planarian/export.json): unit names, a template ending in@.None: missing or unparsable, which the caller treats as fail closed (the watch is not attached). - read_
cgroups - cgroup id (the cgroup directory’s inode) → unit, for every service
cgroup under
root(/sys/fs/cgroup), and the running services’ names. - read_
ifnames - Interface index → name, from
/sys/class/net. - read_
virtual_ ifaces - The virtual links standing: those whose
/sys/class/net/<name>resolves under/sys/devices/virtual/(tun, tap, wireguard, dummy, veth, bridges,lo). A physical NIC’s resolves under its bus device. - unit_
of_ cgroup - The unit a cgroup path belongs to: the first
<name>.serviceundersystem.slice, past any slices (a template’s instances sit in its own slice; a service’s sub-cgroups are its own).Nonefor user sessions, the root, slices: changes from there are unattributed.