It is for testing SystemD services and their installers using docker
1.5K
It is for testing SystemD services and their installers using docker
Tag (and version) | SystemD Version | libc version | libstdc++ version
# we will use the focal version of Ubuntu
ver=20.04
# create container and launch its default command - SystemD
docker run --privileged -t -d --name "systemd-on-ubuntu-${ver}" --rm -v /sys/fs/cgroup:/sys/fs/cgroup:ro devizervlad/systemd-on-ubuntu:${ver}
# make sure SystemD is completely loaded, usually it takes about 1 second
wait_for_systemd="printf 'Wait for systemd on ubuntu "$ver" '; ok=''; for i in {1..9}; do pgrep systemd-journal >/dev/null && ok='true' && echo ' OK' && break || printf '.'; sleep 1; done; [ -z \$ok ] && echo ' Fail';"
docker exec -t "systemd-on-ubuntu-${ver}" bash -c "$wait_for_systemd";
# last, SystemD initialization is completed and we can install, start, check the status and read logs of a SystemD service
# for illustration purposes we just display the full SystemD's journal
docker exec "systemd-on-ubuntu-${ver}" bash -c "journalctl -b";
Content type
Image
Digest
Size
84.9 MB
Last updated
over 4 years ago
docker pull devizervlad/systemd-on-ubuntu:22.10