Commit Graph

5 Commits (e2f9cc7a3a539d39ea5e467d8104e7bdbbdff2c5)

Author SHA1 Message Date
Dustin e2f9cc7a3a container: Symlink /etc/{passwd,group} to /host
When `tmpl` runs `systemd-sysusers` after generating the `sysusers.d`
file for NUT, the `/etc/passwd` and `/etc/group` files on the host are
created anew and replaced, which "breaks" the bind mount.  Since new
files are put in their place, the container and the host no longer see
the same files.  We can work around this by using a symbolic link for
each file, pointing to the respective file in the `/host` directory
(which is the host's `/` directory bind mounted into the container's
namespace).  Since the symlinks follow the file by name rather than
inode, the container's view is always in sync with the host's.
2024-01-14 19:24:55 -06:00
Dustin 79de375b30 container: Fix kcl runtime
As it turns out, KCL literally *compiles* a program from the KCL
sources.  The program it creates needs to link with its runtime library,
`libkclvm_cli_cdylib.so`.  The `kcl` command extracts this library,
along with a helper utility `kclvm_cli`, which performs the actual
compilation and linking.  In a container, `/root/go` is probably mounted
read-only, so we need to extract these files ahead of time and put them
in another location, so the `kcl` command does not have to do it each
time it runs.
2024-01-14 19:24:55 -06:00
Dustin d44e7df8cf nut: Pass explicit path to systemd-sysusers
When `tmpl` substitutes the path of the generated file for `%s` in hook
commands, it uses the full path including the `destdir` prefix.  Since
we're running `tmpl` inside a container, but `systemd-sysusers` outside
it (via `nsenter -t 1`), that path is not correct.  Thus, we need to
explicitly pass the path as `systemd-sysusers` will see it.
2024-01-14 19:24:55 -06:00
Dustin 1d4d29c294 Add Containerfile 2024-01-14 19:24:55 -06:00
Dustin 778c6d440d Initial commit 2024-01-14 19:24:55 -06:00