38 lines
2.2 KiB
Markdown
38 lines
2.2 KiB
Markdown
# mounts
|
|
|
|
What a machine mounts and what it shares over the network, read as tools (novox/hq research 038, shares
|
|
and mounts managed by the mesh).
|
|
|
|
## What it owns
|
|
|
|
Nothing yet. This is the read half of the shares-and-mounts design: it was built because no tool could
|
|
read a machine's fstab, its mount units or its NFS exports, which two failing fstab mounts on the
|
|
workstation needed. The to-be design in novox/hq makes this module write the mount and automount units
|
|
for the shares a node requires; until that design is decided, it declares no resource and changes
|
|
nothing.
|
|
|
|
## What it reads
|
|
|
|
- `/etc/fstab`, every line but swap. A credential in the options (`password=`, `pass=`, `passwd=`) is
|
|
answered as `(redacted)`; a `credentials=` file is named and never opened.
|
|
- The service manager's mount and automount units, with `systemctl list-units` and `systemctl show`:
|
|
state, result, timeout, and whether each was generated from fstab or comes from a unit file. The
|
|
kernel's own filesystems (proc, tmpfs, mqueue and the like) are left out.
|
|
- `/proc/self/mountinfo`, for what is mounted now. A mount point is never opened or statted, so a
|
|
network filesystem whose server is away cannot hang a call.
|
|
- `/etc/exports`, `/etc/exports.d/*.exports` and the kernel's live export table `/var/lib/nfs/etab`.
|
|
- The ZFS `sharenfs` and `sharesmb` properties, where `zfs` is installed.
|
|
- The share sections of `/etc/samba/smb.conf`: path, valid users, read only or writable, force user and
|
|
the like. The `[global]` section and every other setting are left out, so no password or password
|
|
backend is answered.
|
|
|
|
A file that cannot be read, and a command that does not answer, is said under `notes`, never answered
|
|
as empty.
|
|
|
|
## Tools
|
|
|
|
| tool | | answers |
|
|
|---|---|---|
|
|
| `mounts_list` | r | every mount point, its fstab line, its mount and automount units and whether it is mounted now; network filesystems marked; a network mount without automount or nofail said. Narrowed with `network` and `match` |
|
|
| `mounts_exports` | r | the NFS exports declared and live, the ZFS share properties, the Samba shares, and whether nfs-server and smb are active; an export declared and not live, or live and declared nowhere, said |
|