mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
This integration test demonstrates that a containerized systemd instance can write to a bind mounted file observable to the host. Specifically, the bash script uses systemd-run to start a systemd instance as a transient unit container. This systemd-run command bind mounts a directory the container will share with the host, and runs an internal service which creates and writes to a file from the container's view of this directory. When finished writing, the service runs the exit target, terminating the internal systemd instance, and ending the lifetime of the container. The script waits for the container to finish running, then verifies that the expected file contents were written on the host side of the filesystem mount. This test employs a workaround, creating an unmasked procfs mount on the host which enables the privileged guest to create its own mounts internally. This may indicate a systemd bug, as the privileged container should not rely on the existence of an unmasked procfs on the host in order to mount its own filesystems internally.