mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-11-11 07:58:40 +00:00
Otherwise it gets out of sync, and it makes little sense it being in `init` now anyway. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
42 lines
871 B
Bash
Executable File
42 lines
871 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# set global ulimits TODO move to /etc/limits.conf
|
|
ulimit -n 1048576
|
|
ulimit -p unlimited
|
|
|
|
# bring up containerd
|
|
printf "\nStarting containerd\n"
|
|
/usr/bin/containerd &
|
|
|
|
# wait for socket to be there
|
|
while [ ! -S /run/containerd/containerd.sock ]
|
|
do
|
|
sleep 0.1
|
|
done
|
|
|
|
# start onboot containers, run to completion
|
|
|
|
if [ -d /containers/onboot ]
|
|
then
|
|
for f in $(find /containers/onboot -mindepth 1 -maxdepth 1 | sort)
|
|
do
|
|
base="$(basename $f)"
|
|
/bin/mount --bind "$f/rootfs" "$f/rootfs"
|
|
mount -o remount,rw "$f/rootfs"
|
|
/usr/bin/runc run --bundle "$f" "$(basename $f)"
|
|
printf " - $base\n"
|
|
done
|
|
fi
|
|
|
|
# start service containers
|
|
|
|
if [ -d /containers/services ]
|
|
then
|
|
for f in $(find /containers/services -mindepth 1 -maxdepth 1 | sort)
|
|
do
|
|
/bin/mount --bind "$f/rootfs" "$f/rootfs"
|
|
mount -o remount,rw "$f/rootfs"
|
|
service start "$(basename $f)"
|
|
done
|
|
fi
|