| NEX-DEVNODES(8) | NEX Administration | NEX-DEVNODES(8) |
NAME
nex-devnodes - devices of the other NEX nodes as local devices
SYNOPSIS
nex-devnodes [--version]
DESCRIPTION
Runs on every node as a systemd service (nex-devnodes.service). Every 10 seconds (immediately on SIGHUP) it asks the local agent for the list of devices exported by the cluster nodes and for each one creates, with CUSE, /dev/nexdev/NODE/NAME (permissions 0666, udev rule 60-nex-devnodes.rules) and the link /devnodes/NODE/dev/NAME. A device removed from the list or missing on its node disappears; a node that does not respond keeps its devices (opening them gives EHOSTUNREACH).
At every open(2) the daemon opens, through the agent, a channel to the device's node, with the uid of the opening process (given by the kernel); that node applies its rules and opens the real device. Data, termios(3), modem lines, break and flush pass through unchanged; VMIN, VTIME, O_NONBLOCK and poll(2) are applied on the node that opens. Only the serial ioctls in the table pass; the others give ENOTTY.
Exported Unix sockets (version 1.1.0): for each one the daemon creates the listening socket /devnodes/NODE/sock/NAME (0666). For each connection it reads the uid of the peer (SO_PEERCRED) and opens the channel with that uid; the exporting node applies the rules and connects to the real socket as that user, never as root. Data pass in both directions, and so does the half-close.
nex-devnodes --disk NODE NAME (started by nexctl disk attach, in the unit nex-disk-NODE-NAME): attaches the exported disk as /dev/nbdN (the kernel NBD client, configured with ioctls on a socketpair) and passes the NBD requests through the channel to the disk's node, which opens it exclusively. Publishes /devnodes/NODE/disk/NAME; SIGTERM detaches the disk (NBD_DISCONNECT).
nex-devnodes --usb NODE NAME (started by nexctl usb attach): attaches the exported USB device to a free vhci_hcd port with one end of a socketpair and passes the USB/IP protocol through the channel; publishes /devnodes/NODE/usb/NAME; SIGTERM detaches the port.
FILES
- /etc/nex/devnodes.conf
- on the exporting node: one line per device, NAME PATH WHO (users, @groups, * for all non-system users; root only if written explicitly). Empty or missing: nothing exported. It is reread at every request.
- /dev/cuse
- kernel interface for character devices in user space.
open ERRORS
EACCES (the node's rules do not allow it), ENODEV (not exported or not present), EHOSTUNREACH (node not reachable), EBUSY (device in exclusive use). The full reason is in the journal of nex-devnodes and of the agent of the exporting node.
SEE ALSO
nex(1) (nex devices), nexagentd(8), nexctl(8)
| October 2026 | nex-devnodes 1.2.0 |