Files
leleka/scripts/ops

scripts/ops

Owner-run helpers for the 5090 server (rnr5090). Each script prints its usage when run without arguments.

owner-wifi-stability.sh

The server has no free router port and runs on Wi-Fi only (MediaTek MT7925, mt7925e, wlp9s0, netplan + systemd-networkd + netplan-wpa-wlp9s0.service). On 2026-11-02 the link went silent at about 21:35Z with no wpa_supplicant, networkd or kernel message and never came back until a power cycle at 22:46Z. The script installs leleka-wifi-watchdog, a root loop service that pings the gateway every 20 s and, after 3 failures in a row, recovers in escalating steps (L1 ip link down/up, L2 restart the supervisor and networkctl reconfigure, L3 modprobe -r/modprobe mt7925e), logging to the journal and to /run/leleka-wifi-watchdog/ (RAM). At each failure it writes a snapshot (addresses, link counters, signal, PCIe ASPM state, last kernel lines, supervisor journal) to /run/leleka-wifi-watchdog/snapshots/, so the next drop is diagnosable.

bash owner-wifi-stability.sh show                      # read-only: configuration found here and the install plan
bash owner-wifi-stability.sh install --dry-run         # prints the plan, changes nothing
sudo bash owner-wifi-stability.sh install              # watchdog only
sudo bash owner-wifi-stability.sh install --disable-powersave --install-iw   # + Wi-Fi power save off (needs the iw package)
sudo bash owner-wifi-stability.sh install --disable-aspm                     # + mt7925e disable_aspm=1 (next module load)
sudo bash owner-wifi-stability.sh install --reboot-after-min 45              # + last resort reboot (kills GPU jobs)
bash owner-wifi-stability.sh status                    # counters, action log, snapshots
sudo bash owner-wifi-stability.sh remove

install never brings the link down and never touches sshd (22), the rescue sshd (2222, rescue-sshd.sh), docker or the GPU queue. Do not run install with --disable-aspm and then reload the module over an SSH session that rides on the same Wi-Fi.

Test without changing anything (the loop only prints what it would do, probes and snapshots are read-only):

WD_SETTLE=1 bash owner-wifi-stability.sh run --dry-run --iface wlp9s0 --module mt7925e --simulate-fail 22 --interval 1 --max-loops 26