mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-27 12:38:11 +00:00
Add onshutdown support to runc
This will run any containers in `/containers/onshutdown` on a clean shutdown. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
parent
fe8f979da5
commit
c6aa7b9053
15
pkg/runc/etc/shutdown.d/010-onshutdown
Executable file
15
pkg/runc/etc/shutdown.d/010-onshutdown
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# start onshutdown containers, run to completion
|
||||||
|
|
||||||
|
if [ -d /containers/onshutdown ]
|
||||||
|
then
|
||||||
|
for f in $(find /containers/onshutdown -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
|
Loading…
Reference in New Issue
Block a user