|
1 | 1 | #!/bin/bash |
2 | 2 |
|
| 3 | +echo "Entering $0 at $(date) " |
| 4 | + |
| 5 | +if [ ! -f /sys/fs/cgroup/cgroup.controllers ]; then |
| 6 | + echo "Using cgroup v1" |
| 7 | +else |
| 8 | + echo "Using cgroup v2" |
| 9 | + CURRENT_CGROUP=$(cat /proc/self/cgroup | sed 's/0:://') |
| 10 | + echo "Current cgroup: ${CURRENT_CGROUP}" |
| 11 | + |
| 12 | + MEMORY_OOM_GROUP_VALUE=$(cat "/sys/fs/cgroup/${CURRENT_CGROUP}/memory.oom.group") |
| 13 | + echo "Current memory.oom.group value: ${MEMORY_OOM_GROUP_VALUE}" |
| 14 | + |
| 15 | + if [[ "${MEMORY_OOM_GROUP_VALUE}" == "1" ]]; then |
| 16 | + echo "Warning! memory.oom.group is set to 1 for the current cgroup, OOM events will not be handled properly by the platform. \ |
| 17 | +Set singleProcessOOMKill=true for kubelet configuration to fix it." 1>&2; |
| 18 | + fi |
| 19 | +fi |
| 20 | + |
3 | 21 | DIR=$(dirname $0) |
4 | 22 |
|
5 | | -echo "Entering $0 at $(date) " |
6 | 23 | DOCKERD_DATA_ROOT=${DOCKERD_DATA_ROOT:-/home/rootless/.local/share/docker} |
7 | 24 | DIND_VOLUME_STAT_DIR=${DIND_VOLUME_STAT_DIR:-${DOCKERD_DATA_ROOT}/dind-volume} |
8 | 25 | DIND_VOLUME_CREATED_TS_FILE=${DIND_VOLUME_STAT_DIR}/created |
|
190 | 207 |
|
191 | 208 | echo "Starting dockerd rootless" |
192 | 209 |
|
193 | | - if [ ! -f /sys/fs/cgroup/cgroup.controllers ]; then |
194 | | - echo "Using cgroup v1" |
195 | | - else |
196 | | - echo "Using cgroup v2" |
197 | | - CURRENT_CGROUP=$(cat /proc/self/cgroup | sed 's/0:://') |
198 | | - echo "Current cgroup: ${CURRENT_CGROUP}" |
199 | | - |
200 | | - MEMORY_OOM_GROUP_VALUE=$(cat "/sys/fs/cgroup/${CURRENT_CGROUP}/memory.oom.group") |
201 | | - echo "Current memory.oom.group value: ${MEMORY_OOM_GROUP_VALUE}" |
202 | | - |
203 | | - if [[ "${MEMORY_OOM_GROUP_VALUE}" == "1" ]]; then |
204 | | - echo "Warning! memory.oom.group is set to 1 for the current cgroup, OOM events will not be handled properly by the platform. \ |
205 | | -Set singleProcessOOMKill=true for kubelet configuration to fix it." 1>&2; |
206 | | - fi |
207 | | - fi |
208 | | - |
209 | 210 | export DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS="-p 0.0.0.0:1300:1300/tcp" # Expose rooltelsskit port |
210 | 211 | dockerd-entrypoint.sh dockerd --feature containerd-snapshotter=false ${DOCKERD_PARAMS} <&- & |
211 | 212 |
|
|
0 commit comments