Skip to content

Commit

Permalink
Fix docker power failure issue
Browse files Browse the repository at this point in the history
Root directory for execution state files and directory for pidfile needs to be present in tempfs. Keeping them in a non-tempfs directory may lead to corruption of files if there is an unexpected power failure. This might lead to dockerd failing to start again after reboot. Keeping these files in tempfs endures that these filesare wiped out after a power failure. exec-root and pidfile options in dockerd command are /var/run/docker and /var/run/docker.pid respectively by default. (https://docs.docker.com/engine/reference/commandline/dockerd/)
  • Loading branch information
psppalash authored and mray190 committed May 15, 2020
1 parent 45f57fe commit 2ed9a52
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions files/docker/bin/dockerd-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ trap - EXIT
# use SNAP_DATA for most "data" bits
mkdir -p \
"$SNAP_DATA/run" \
"/var/run/pelion-edge" \
"/var/run/pelion-edge/docker" \
"$SNAP_DATA/run/docker" \
"$SNAP_COMMON/var-lib-docker"

Expand All @@ -56,8 +58,8 @@ workaround_apparmor_profile_reload

exec dockerd \
-G $default_socket_group \
--exec-root="$SNAP_DATA/run/docker" \
--exec-root="/var/run/pelion-edge/docker" \
--data-root="$SNAP_COMMON/var-lib-docker" \
--pidfile="$SNAP_DATA/run/docker.pid" \
--pidfile="/var/run/pelion-edge/docker.pid" \
--config-file="$SNAP_DATA/config/daemon.json" \
"$@"

0 comments on commit 2ed9a52

Please sign in to comment.