-
Notifications
You must be signed in to change notification settings - Fork 0
/
start
37 lines (34 loc) · 1.02 KB
/
start
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
ID=$(id -u)
if test -z "${XDG_RUNTIME_DIR}"; then
export XDG_RUNTIME_DIR=/tmp/$ID
if ! test -d "${XDG_RUNTIME_DIR}"; then
mkdir -p "${XDG_RUNTIME_DIR}"
chmod 0700 "${XDG_RUNTIME_DIR}"
fi
fi
while true
do
#check bypass first
if pgrep -U $ID -x /usr/local/bin/bypass4netnsd
then
echo "bypass4netnsd is running"
logger "bypass4netnsd is running"
else
/usr/local/bin/bypass4netnsd &
logger "Starting bypass4netnsd"
fi
#Only run containerd if bypass is running
if pgrep -U $ID -x /usr/local/bin/bypass4netnsd
then
if pgrep -U $ID -x containerd
then
echo "containerd is running"
logger "containerd is running"
else
/usr/local/bin/containerd-rootless.sh &
logger "Starting containerd-rootless.sh"
fi
fi
sleep 300
done