diff --git a/CLAUDE.md b/CLAUDE.md index 04bb59f..ddfea11 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -73,12 +73,12 @@ miguel, pablo, patrick SFTP chroot: `/home/USER/html/` -### ASIR1 (21) — usernames = apellido en minúsculas +### ASIR1 (22) — usernames = apellido en minúsculas ``` barja, barrios, cayo, contrera, duque, florea, gomes, izquierdo, jara, lillo, linares, macedo, martinez, munoz, olcina, ponce, -posada, quiroz, reynoso, sierra, torrero +posada, quiroz, reynoso, rodriguez, sierra, torrero ``` SFTP chroot: `/home/USER/python/` · Contraseñas: leet-speak (`a→4, e→3, i→1, o→0`) diff --git a/scripts/README.md b/scripts/README.md index 9230423..e849c5e 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -15,6 +15,8 @@ Copia de referencia de todos los scripts y unidades systemd desplegados en **zzz | **`nginx-user-config-watcher.service`** | `zzz:/etc/systemd/system/` | Unit systemd para el watcher DDAW2 | | **`home-fenix-napi-data.mount`** | `aldebaran:~/.config/systemd/user/` | Mount sshfs `~/napi-data/` → `zzz:/var/www/napi/data/` (DDAW2) | | **`home-fenix-napi-data2.mount`** | `aldebaran:~/.config/systemd/user/` | Mount sshfs `~/napi-data2/` → `zzz:/var/www/napi2/data/` (ASIR1) | +| **`napi-mount-watchdog.service`** | `aldebaran:~/.config/systemd/user/` | Watchdog — reinicia mounts sshfs caídos | +| **`napi-mount-watchdog.timer`** | `aldebaran:~/.config/systemd/user/` | Timer — ejecuta watchdog cada 12 min | --- @@ -125,8 +127,20 @@ systemctl --user status home-fenix-napi\\x2ddata2.mount # ASIR1 # Montar/desmontar systemctl --user start home-fenix-napi\\x2ddata2.mount systemctl --user stop home-fenix-napi\\x2ddata2.mount + +# Watchdog (auto-recovery de mounts caídos) +systemctl --user status napi-mount-watchdog.timer +systemctl --user list-timers napi-mount-watchdog.timer ``` +### 🐕 napi-mount-watchdog (timer + service) + +**Propósito:** Auto-recuperación de mounts sshfs caídos. Si zzz se reinicia o la conexión SSH se corta, el watchdog detecta los mounts en estado `failed` y los reinicia automáticamente. + +- ⏱️ **Frecuencia:** cada 12 minutos (+ 30s tras boot) +- 🔍 **Lógica:** comprueba `is-active` de ambos `.mount` → reinicia los que no estén `active` +- 🛡️ **Complementa** el `reconnect` de sshfs (que solo maneja blips breves, no fallos de mount inicial) + --- ## 🏗️ Estructura de directorios en zzz @@ -166,3 +180,4 @@ systemctl --user stop home-fenix-napi\\x2ddata2.mount | `python-upload-watcher.sh` | **v7** | 2026-02-25 | Batching + re-entregas + Windows-safe + `__pycache__` filter + nombres completos | | `nginx-user-config-watcher.sh` | **v3** | 2026-02-19 | Multi-sitio + undeploy + CSP analysis | | `xmpp-notify.py` | **v1** | 2026-01-27 | Bot one-shot slixmpp | +| `napi-mount-watchdog` | **v1** | 2026-03-10 | Timer+service watchdog para auto-recovery de mounts sshfs | diff --git a/scripts/napi-mount-watchdog.service b/scripts/napi-mount-watchdog.service new file mode 100644 index 0000000..4faf893 --- /dev/null +++ b/scripts/napi-mount-watchdog.service @@ -0,0 +1,12 @@ +[Unit] +Description=Restart failed napi sshfs mounts + +[Service] +Type=oneshot +ExecStart=/bin/bash -c '\ + for unit in home-fenix-napi\\x2ddata.mount home-fenix-napi\\x2ddata2.mount; do \ + state=$(systemctl --user is-active "$unit" 2>/dev/null); \ + if [ "$state" != "active" ]; then \ + systemctl --user restart "$unit"; \ + fi; \ + done' diff --git a/scripts/napi-mount-watchdog.timer b/scripts/napi-mount-watchdog.timer new file mode 100644 index 0000000..d78a590 --- /dev/null +++ b/scripts/napi-mount-watchdog.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Check napi sshfs mounts every 2 minutes + +[Timer] +OnBootSec=30 +OnUnitActiveSec=12min + +[Install] +WantedBy=timers.target