#!/bin/sh # TODO more robust # while [ ! -S /run/containerd/containerd.sock ]; do sleep 1; done # while ! ctr list 2> /dev/null; do sleep 1; done # start system containers # temporarily using runc not containerd LOG=/var/log/system-containers.log touch $LOG if [ -d /containers/system ] then for f in $(find /containers/system -mindepth 1 -maxdepth 1 | sort) do base="$(basename $f)" /usr/bin/runc run --bundle "$f" "$(basename $f)" printf " - $base\n" done fi if [ -d /containers/daemon ] then for f in $(find /containers/daemon -mindepth 1 -maxdepth 1 | sort) do base="$(basename $f)" /sbin/start-stop-daemon --start --pidfile /run/$base.pid --exec /usr/bin/runc -- run --bundle "$f" --pid-file /run/$base.pid "$(basename $f)" $LOG >$LOG & printf " - $base\n" done fi wait