diff --git a/scripts/servidor/cards/montar-trabajo.json b/scripts/servidor/cards/montar-trabajo.json new file mode 100644 index 00000000..e7f76dc1 --- /dev/null +++ b/scripts/servidor/cards/montar-trabajo.json @@ -0,0 +1,62 @@ +{ + "id": "01M2F0NTARTRABAJ0V0VMEN012", + "label": "montar-trabajo", + "lifecycle": "oneshot", + "supervision": "OneShot", + "priority": "normal", + "lineage": null, + "provides": [], + "requires": [], + "flow": { + "input": [], + "output": [] + }, + "genesis": [], + "permissions": { + "filesystem": "read-write", + "networking": "none", + "processes": true, + "ipc": { + "allow": [] + } + }, + "soma": { + "cgroup": { + "cpu_weight": null, + "io_weight": null, + "path": "arje.slice/montar-trabajo" + }, + "cpu_affinity": null, + "namespaces": { + "cgroup": false, + "ipc": false, + "mount": false, + "net": false, + "pid": false, + "user": false, + "uts": false + }, + "rlimits": { + "mem_bytes": null, + "nofile": null, + "nproc": null + } + }, + "schema_version": 1, + "payload": { + "Native": { + "exec": "/bin/busybox", + "envp": [ + [ + "PATH", + "/usr/sbin:/usr/bin:/sbin:/bin" + ] + ], + "argv": [ + "sh", + "-c", + "mkdir -p /run/user; chmod 1777 /run/user; for h in /home/*; do u=$(basename $h); id -u $u >/dev/null 2>&1 || continue; mkdir -p /run/user/$(id -u $u); chown $u /run/user/$(id -u $u); chmod 700 /run/user/$(id -u $u); done; d=$(blkid -L trabajo 2>/dev/null); test -n \"$d\" || { echo montar-trabajo: ningun disco con LABEL=trabajo — el volumen no esta enchufado >&2; exit 78; }; mkdir -p /vvv; grep -q /vvv /proc/mounts || mount \"$d\" /vvv || { echo montar-trabajo: no pude montar el volumen >&2; exit 78; }; test -d /vvv/sergio || exit 0; mkdir -p /work/sergio; grep -q /work/sergio /proc/mounts || mount --bind /vvv/sergio /work/sergio; echo \"montar-trabajo: /vvv $(df -h /vvv | awk NR==2{print }) libres\"" + ] + } + } +} \ No newline at end of file diff --git a/scripts/servidor/perfil/profile b/scripts/servidor/perfil/profile new file mode 100644 index 00000000..58473cb7 --- /dev/null +++ b/scripts/servidor/perfil/profile @@ -0,0 +1,6 @@ +# /etc/profile — lo lee toda shell de LOGIN. Existe para que `/etc/profile.d/*.sh` sirva de algo: +# el directorio estaba y nadie lo leía (2026-09-18). +for _f in /etc/profile.d/*.sh; do + [ -r "$_f" ] && . "$_f" +done +unset _f diff --git a/scripts/servidor/perfil/rust-enlazador.sh b/scripts/servidor/perfil/rust-enlazador.sh new file mode 100644 index 00000000..f3a26935 --- /dev/null +++ b/scripts/servidor/perfil/rust-enlazador.sh @@ -0,0 +1,3 @@ +# El enlace de rust pasa por el driver de C (ver /usr/bin/cc). Sin esto no enlaza ninguna dylib, +# o sea ninguna proc-macro. SDD 28 §6.52. +export RUSTFLAGS="${RUSTFLAGS:-} -C linker=cc -C linker-flavor=gcc -C link-self-contained=no" diff --git a/scripts/servidor/perfil/xdg-runtime.sh b/scripts/servidor/perfil/xdg-runtime.sh new file mode 100644 index 00000000..4e7b49e8 --- /dev/null +++ b/scripts/servidor/perfil/xdg-runtime.sh @@ -0,0 +1,9 @@ +# Esta caja no tiene logind, así que nadie crea /run/user/ ni exporta XDG_RUNTIME_DIR. Sin eso, +# cada programa elige su propio repliegue y dejan de encontrarse: `shuma-tui` buscaba en +# `$XDG_RUNTIME_DIR/shuma.sock` (o sea, en la nada) mientras `shuma-daemon` abría +# `/tmp/shuma-.sock`. Medido en la caja el 2026-09-18. +if [ -z "${XDG_RUNTIME_DIR:-}" ]; then + XDG_RUNTIME_DIR=/run/user/$(id -u) + [ -d "$XDG_RUNTIME_DIR" ] || { mkdir -p "$XDG_RUNTIME_DIR" 2>/dev/null && chmod 700 "$XDG_RUNTIME_DIR" 2>/dev/null; } + export XDG_RUNTIME_DIR +fi