Bind image on startup ignores /etc/default/named configuration

Bug #1969756 reported by Matvey Teplov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Docker Images
Fix Released
Medium
Sergio Durigan Junior

Bug Description

Container startup procedure at /usr/local/bin/docker-entrypoint.sh doesn't have the initial configuration file mentioned in any manner. Hence, the userchange, for instance, is not possible - it will always start as a bind user.

#!/bin/bash
set -e

# allow arguments to be passed to named
if [[ "${1:0:1}" == '-' ]]; then
    EXTRA_ARGS="${*}"
    set --
elif [[ "${1}" == "named" || "${1}" == "$(command -v named)" ]]; then
    EXTRA_ARGS="${*:2}"
    set --
fi

# default behaviour is to launch named
if [[ -z "${1}" ]]; then
    echo "Starting named..."
    echo "exec $(which named) -g \"${EXTRA_ARGS}\""
    exec $(command -v named) -u bind -g ${EXTRA_ARGS}
else
    exec "${@}"
fi

Related branches

Changed in ubuntu-docker-images:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Sergio Durigan Junior (sergiodj)
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thanks for taking the time to report the bug.

Initially I don't think it makes much sense to use /etc/default/named in order to configure named's initialization options. In the container world, it seems to me that it's much more common to control the behaviour of application via environment variables.

I agree that it should be possible for users to select which user will own the named process, so I went ahead and implemented support for a new environment variable, BIND9_USER, which can be set when creating the container.

The image has been rebuilt and retagged, so this new variable should be supported in the latest tag. We are working on updating the image documentation to reflect it as well. For this reason, I'm marking this bug as Fix Released. Let us know if this works for you.

Thanks.

Changed in ubuntu-docker-images:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.