Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Add partial support for non-FHS host systems
Browse files Browse the repository at this point in the history
Fixes #2733 partially, where <host>/etc/resolv.conf is not a
symlink
  • Loading branch information
roberth committed Jan 18, 2017
1 parent 81add75 commit d881f47
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion weave
Original file line number Diff line number Diff line change
Expand Up @@ -1667,7 +1667,16 @@ launch_router() {
--label=weavevolumes $WEAVEDB_IMAGE >/dev/null
fi

RESOLV_CONF=$(chroot ${HOST_ROOT:-/} readlink -f /etc/resolv.conf)
# Figure out the location of the actual resolv.conf file because
# we want to bind mount its directory into the container.
if [ -L ${HOST_ROOT:-/}/etc/resolv.conf ]; then # symlink
# This assumes a host with readlink in FHS directories...
# Ideally, this would resolve the symlink manually, without
# using host commands.
RESOLV_CONF=$(chroot ${HOST_ROOT:-/} readlink -f /etc/resolv.conf)
else
RESOLV_CONF=/etc/resolv.conf
fi
RESOLV_CONF_DIR=$(dirname "$RESOLV_CONF")
RESOLV_CONF_BASE=$(basename "$RESOLV_CONF")

Expand Down

0 comments on commit d881f47

Please sign in to comment.