Files
fn-serverless/images/dind/preentry.sh
Tolga Ceylan c132cf1825 fn: dind SIGINT and SIGCHLD changes (#771)
1) in dind, prevent SIGINT reaching to dockerd. This kills
docker and prevents shutdown as fn server is trying to stop.
2) as init process, always reap child processes.
2018-02-13 19:46:53 -08:00

21 lines
520 B
Bash
Executable File

#!/bin/sh
set -euo pipefail
fsdriver=$(grep -Eh -w -m1 "overlay|aufs" /proc/filesystems | cut -f2)
if [ $fsdriver == "overlay" ]; then
fsdriver="overlay2"
fi
mtu=$(ip link show dev $(ip route |
awk '$1 == "default" { print $NF }') |
awk '{for (i = 1; i <= NF; i++) if ($i == "mtu") print $(i+1)}')
# activate job control, prevent docker process from receiving SIGINT
set -m
dockerd-entrypoint.sh --storage-driver=$fsdriver --mtu=$mtu &
# give docker a few seconds
sleep 3
exec "$@"