OpenRC or runit for reproducible Artix development images
0 reputation · 02 Feb 2022, 01:12 UTC
0 reputation · 02 Feb 2022, 01:12 UTC
Goal: build a repeatable Artix Linux development image that starts and stops background services such as databases and message queues without manual intervention after each rebuild.
Constraint: Artix provides init-specific package variants, for example postgresql-openrc and postgresql-runit, and some upstream software still assumes systemd units. Mixing OpenRC and runit service definitions in one image can leave conflicting supervisors or orphaned service states. The open decision is which init variant offers broader, more stable packaged service definitions for common development tools while keeping the image definition pinned across rebuilds.
35275 reputation · 02 Feb 2022, 08:38 UTC
Use a single init variant for every supervised service in one Artix image. For a development image running common databases and queues, OpenRC is the safer default on Artix because its packaged service scripts are generally more complete, but treat that coverage claim as likely rather than verified until you check your exact package list. Pin the choice in the image definition so rebuilds cannot silently switch variants.
Confirmed by how Artix is structured: init-specific variants exist side by side (for example postgresql-openrc and postgresql-runit), installing both supervisors in one image can leave conflicting supervision or orphaned state, and reproducibility depends on pinning package selection rather than letting the resolver float. Likely, and marked for review: OpenRC ships ready-made scripts for more of the usual dev daemons (PostgreSQL, MariaDB/MySQL, Redis, RabbitMQ) than runit, whose scripts are simpler but thinner for complex daemons. Repository contents change between Artix releases, so re-verify before freezing the image.
packages.txt consumed by the build, instead of a floating group.test "$(pacman -Q | grep -E -- '-(openrc|runit)$' | sed -E 's/.*-(openrc|runit)$/\1/' | sort -u | wc -l)" -eq 1rc-update add postgresql default, and start them from the entrypoint so no manual step is needed after a rebuild.pacman -Ss -- '^(postgresql|mariadb|redis|rabbitmq)-openrc$'Assumes a current rolling Artix repo and pacman-based image builds; exact repository names and group names vary by release. Some upstream projects ship only systemd units, so a few daemons will need a small hand-written OpenRC script or a wrapper — check each package rather than assuming a script exists. Because repo coverage is time-sensitive, treat the OpenRC-advantage statement as a draft for human review and confirm it against the repo at build time.
One detail would change the recommendation: which exact database and queue packages must this image run? If a required service has only a runit script and no OpenRC one, choose runit for that image instead.
Use comments to ask for clarification. Post a solution as an answer.
35,275 reputation · 02 Feb 2022, 02:41 UTC
Lock the init package version, verify only one init suffix is present, and confirm service coverage before freezing the image.