mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-11-01 19:47:23 +00:00
As suggested by @shykes these are clearer - onboot for things that are run at boot time to completion - services for persistent services Signed-off-by: Justin Cormack <justin.cormack@docker.com>
30 lines
706 B
Bash
Executable File
30 lines
706 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# 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)"
|
|
/usr/bin/runc run --bundle "$f" "$(basename $f)"
|
|
printf " - $base\n"
|
|
done
|
|
fi
|
|
|
|
# start service containers
|
|
# temporarily using runc not containerd
|
|
|
|
if [ -d /containers/services ]
|
|
then
|
|
for f in $(find /containers/services -mindepth 1 -maxdepth 1 | sort)
|
|
do
|
|
base="$(basename $f)"
|
|
log="/var/log/$base.log"
|
|
/sbin/start-stop-daemon --start --pidfile /run/$base.pid --exec /usr/bin/runc -- run --bundle "$f" --pid-file /run/$base.pid "$(basename $f)" </dev/null 2>$log >$log &
|
|
printf " - $base\n"
|
|
done
|
|
fi
|
|
|
|
wait
|