# s6-lua A port of the community s6/s6-rc service catalog (the kind Artix Linux/Obarun use in place of systemd units) into Lua-based service definitions. Stock Lua has no `exec()` binding, and `os.execute("exec daemon")` doesn't solve the problem either — it forks a shell that execs, but the Lua process itself stays alive blocked in `waitpid()`, so s6 ends up supervising the interpreter instead of the daemon. `longrun` services here hand off to the real daemon through a tiny vendored C module (`src/native/s6exec.c`, `execvp()`); `oneshot` and `finish` scripts don't need it since they run to completion rather than persisting. See `docs/CONVENTIONS.md` for the full rationale and naming rules. ## Layout ``` services/ the s6-rc source-definition tree (deploys verbatim to /etc/s6/sv) src/lua/ shared helper library (s6lua.lua) every service script requires src/native/ native exec binding (s6exec.c) + Makefile, Linux-only build tools/ generator, structural linter, syntax checker, exec-bit fixer, installer docs/ conventions and naming rules ``` `services/default` is the top-level bundle (boots to graphical target with SDDM); `services/boot` is the multi-user/console-only target. ## Status Authored and syntax-checked only — there is no live s6/s6-rc install in this environment to boot- test against. See `docs/CONVENTIONS.md` for known unverified gaps (daemon flags reconstructed from convention, not confirmed against Artix's actual catalog) and the recommended next step (install s6/s6-rc/s6-linux-init on a Linux host — Arch is the closest packaging match — and boot-test the `boot` bundle before enabling `graphical`). ## Local tooling Requires `lua55`/`luac55` (this repo was authored against Lua 5.5, written to a subset valid under 5.4 too — see `docs/CONVENTIONS.md`). ```powershell lua55 tools/gen-services.lua # regenerate the -srv/-log pairs + agetty ttys from tools/catalog.lua lua55 tools/lint.lua # structural validation of services/ tools/check-syntax.ps1 # luac55 -p over every script tools/set-exec-bits.ps1 # fix the git executable bit before committing (Windows checkout) ``` `tools/install.sh` deploys everything to a real Linux target (untested this session).