Ports the community s6/s6-rc service catalog (early-boot mounts, udev,
dbus, session/power, networking, display managers, peripheral daemons)
to Lua-based service definitions.
- src/lua/s6lua.lua: shared helper library (exec, logging, fstab
parsing, oneshot shell runner, readiness notification)
- src/native/s6exec.c: minimal execvp() binding so longrun `run`
scripts can replace their own process image with the real daemon,
since stock Lua has no exec() and os.execute("exec ...") does not
solve it (the interpreter stays alive as an unsupervised parent)
- tools/catalog.lua + gen-services.lua: table-driven generator for
the structurally identical -srv/-log daemon pairs and agetty ttys
- tools/lint.lua, check-syntax.ps1, set-exec-bits.ps1: local
verification (no live s6/Linux target available this session)
- services/: 50 service directories (14 early-boot oneshots, 12
daemon srv/log pairs, 6 agetty ttys, boot/mount/setup/ttys/
graphical/default bundles)
Authored and syntax/structurally validated only. Native module is
unbuilt and daemon flags are unverified against Artix's real catalog
(gitea was unreachable during research) -- see docs/CONVENTIONS.md.
94 lines
2.9 KiB
Lua
94 lines
2.9 KiB
Lua
-- Data table consumed by gen-services.lua to stamp out the structurally
|
|
-- identical -srv/-log longrun pairs and agetty-tty1..6, instead of hand-
|
|
-- authoring ~40 near-duplicate service directories.
|
|
--
|
|
-- KNOWN GAP: Artix's own `s6-scripts` gitea repo blocked automated fetches
|
|
-- during research for this catalog, so argv/flags below are reconstructed
|
|
-- from each daemon's own documented foreground-mode flag (dbus-daemon
|
|
-- --nofork, NetworkManager --no-daemon, chronyd/bluetoothd/acpid/cupsd -n/-f)
|
|
-- rather than confirmed byte-for-byte against a reference script. Spot-check
|
|
-- against the real Artix catalog (or the daemon's man page) before relying
|
|
-- on this in production; this table is the single place to correct it.
|
|
--
|
|
-- To add a new daemon: append a row to `daemons` and rerun
|
|
-- `lua55 tools/gen-services.lua`.
|
|
|
|
return {
|
|
daemons = {
|
|
{
|
|
key = "udevd", srv = "udevd-srv", log = "udevd-log",
|
|
argv = { "/usr/lib/udev/udevd" },
|
|
log_dir = "/var/log/udevd",
|
|
deps = { "mount-devfs" },
|
|
},
|
|
{
|
|
key = "dbus", srv = "dbus-srv", log = "dbus-log",
|
|
argv = { "/usr/bin/dbus-daemon", "--system", "--nofork", "--nopidfile" },
|
|
log_dir = "/var/log/dbus",
|
|
deps = { "mount-procfs", "mount-sysfs" },
|
|
},
|
|
{
|
|
key = "elogind", srv = "elogind-srv", log = "elogind-log",
|
|
argv = { "/usr/lib/elogind/elogind" },
|
|
log_dir = "/var/log/elogind",
|
|
deps = { "dbus-srv" },
|
|
},
|
|
{
|
|
key = "seatd", srv = "seatd-srv", log = "seatd-log",
|
|
argv = { "/usr/bin/seatd", "-g", "seat" },
|
|
log_dir = "/var/log/seatd",
|
|
deps = {},
|
|
},
|
|
{
|
|
key = "networkmanager", srv = "networkmanager-srv", log = "networkmanager-log",
|
|
argv = { "/usr/bin/NetworkManager", "--no-daemon" },
|
|
log_dir = "/var/log/networkmanager",
|
|
deps = { "dbus-srv" },
|
|
},
|
|
{
|
|
key = "chronyd", srv = "chronyd-srv", log = "chronyd-log",
|
|
argv = { "/usr/bin/chronyd", "-n" },
|
|
log_dir = "/var/log/chronyd",
|
|
deps = { "mount-filesystems" },
|
|
},
|
|
{
|
|
key = "bluetoothd", srv = "bluez-srv", log = "bluez-log",
|
|
argv = { "/usr/lib/bluetooth/bluetoothd", "-n" },
|
|
log_dir = "/var/log/bluez",
|
|
deps = { "dbus-srv" },
|
|
},
|
|
{
|
|
key = "acpid", srv = "acpid-srv", log = "acpid-log",
|
|
argv = { "/usr/sbin/acpid", "-f" },
|
|
log_dir = "/var/log/acpid",
|
|
deps = { "mount-procfs" },
|
|
},
|
|
{
|
|
key = "cupsd", srv = "cupsd-srv", log = "cupsd-log",
|
|
argv = { "/usr/sbin/cupsd", "-f" },
|
|
log_dir = "/var/log/cupsd",
|
|
deps = { "dbus-srv" },
|
|
},
|
|
{
|
|
key = "gdm", srv = "gdm-srv", log = "gdm-log",
|
|
argv = { "/usr/bin/gdm" },
|
|
log_dir = "/var/log/gdm",
|
|
deps = { "dbus-srv", "elogind-srv" },
|
|
},
|
|
{
|
|
key = "sddm", srv = "sddm-srv", log = "sddm-log",
|
|
argv = { "/usr/bin/sddm" },
|
|
log_dir = "/var/log/sddm",
|
|
deps = { "dbus-srv", "elogind-srv" },
|
|
},
|
|
{
|
|
key = "lightdm", srv = "lightdm-srv", log = "lightdm-log",
|
|
argv = { "/usr/sbin/lightdm" },
|
|
log_dir = "/var/log/lightdm",
|
|
deps = { "dbus-srv", "elogind-srv" },
|
|
},
|
|
},
|
|
|
|
ttys = { 1, 2, 3, 4, 5, 6 },
|
|
}
|