feat: read the sockets of a host without ss from netstat, and procd's services #15

Merged
christianmanivong merged 1 commits from feat/listening-netstat into main 2026-10-07 05:21:31 +00:00
Owner

OpenWrt has no ss, so the listening-socket command raised ListeningSocketsUnavailable there. Without ss it now runs netstat -lntup (busybox and net-tools), and reads the cgroups for its PIDs the same way.

  • netstat's PID/Program column; UDP lines without a state column; - for a socket without a process; net-tools' tcp6/udp6 and program names with a space.
  • On OpenWrt the cgroup is /services/<name>/<instance>, so unit is the procd service, a jailed one too (dnsmasq under ujail has another PID than procd reports).
  • A host with neither tool still raises ListeningSocketsUnavailable.

Checked live: a real OpenWrt 25.12.2 access point (all sockets with their procd service). A Linux and a Proxmox host still read the same 15 sockets with the longer command.

Version 2.5.0. For NetOrk/netork#673.

OpenWrt has no `ss`, so the listening-socket command raised `ListeningSocketsUnavailable` there. Without `ss` it now runs `netstat -lntup` (busybox and net-tools), and reads the cgroups for its PIDs the same way. - netstat's `PID/Program` column; UDP lines without a state column; `-` for a socket without a process; net-tools' `tcp6`/`udp6` and program names with a space. - On OpenWrt the cgroup is `/services/<name>/<instance>`, so `unit` is the procd service, a jailed one too (dnsmasq under ujail has another PID than procd reports). - A host with neither tool still raises `ListeningSocketsUnavailable`. **Checked live:** a real OpenWrt 25.12.2 access point (all sockets with their procd service). A Linux and a Proxmox host still read the same 15 sockets with the longer command. Version 2.5.0. For NetOrk/netork#673.
christianmanivong added 1 commit 2026-10-07 05:20:50 +00:00
OpenWrt has no ss: the listening-socket command fell through to [no-ss]
and the reading raised ListeningSocketsUnavailable. Without ss it now runs
netstat -lntup (busybox and net-tools both), and the cgroups are read for
its PIDs alike.

- netstat names a socket's process as PID/Program; a UDP line has no
  state column, "-" is a socket without a process, and net-tools prints
  tcp6/udp6 and program names with a space ("sshd: /usr/sbin").
- On OpenWrt the cgroup is /services/<name>/<instance>, so the unit is
  the procd service -- a jailed one too, whose PID is not the one procd
  reports (dnsmasq under ujail).
- A host with neither tool still raises ListeningSocketsUnavailable.

Checked against a real OpenWrt 25.12.2 access point, and that a Linux and
a Proxmox host still read the same sockets with the longer command.

2.5.0. For netOrk#673.
christianmanivong merged commit 1112191aec into main 2026-10-07 05:21:31 +00:00
christianmanivong deleted branch feat/listening-netstat 2026-10-07 05:21:31 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-device-types#15