Merge ~sergiodj/ubuntu-docker-images/+git/bind9:bind9-user into ~ubuntu-docker-images/ubuntu-docker-images/+git/bind9:9.18-22.04

Proposed by Sergio Durigan Junior
Status: Merged
Merged at revision: 738992785e31c0fcc842765f12c9f8d667df0e9b
Proposed branch: ~sergiodj/ubuntu-docker-images/+git/bind9:bind9-user
Merge into: ~ubuntu-docker-images/ubuntu-docker-images/+git/bind9:9.18-22.04
Diff against target: 22 lines (+6/-2)
1 file modified
docker-entrypoint.sh (+6/-2)
Reviewer Review Type Date Requested Status
Athos Ribeiro Approve
Bryce Harrington Approve
Canonical Server Pending
Review via email: mp+420289@code.launchpad.net

Description of the change

This MP improves bind9's entrypoint script to allow the specification of a user that will own the named process.

Currently we force the user to be "bind", but I think it makes sense to make this into a changeable setting (just like it is in the Debian package, through /etc/default/named).

This change was prompted by bug #1969756.

To post a comment you must log in.
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

If this MP is approved I will work on updating the image's README.

Revision history for this message
Bryce Harrington (bryce) wrote :

Yep makes sense. Oversight on my part to not include it as a configurable, sorry.
At least people are evidently looking at the image, that's good. :-)

review: Approve
Revision history for this message
Athos Ribeiro (athos-ribeiro) :
review: Approve
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thanks, guys. I'm going to file an MP for the documentation soon.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
index 4c8d14d..d04bfee 100755
--- a/docker-entrypoint.sh
+++ b/docker-entrypoint.sh
@@ -10,11 +10,15 @@ elif [[ "${1}" == "named" || "${1}" == "$(command -v named)" ]]; then
10 set --10 set --
11fi11fi
1212
13# The user which will start the named process. If not specified,
14# defaults to 'bind'.
15BIND9_USER="${BIND9_USER:-bind}"
16
13# default behaviour is to launch named17# default behaviour is to launch named
14if [[ -z "${1}" ]]; then18if [[ -z "${1}" ]]; then
15 echo "Starting named..."19 echo "Starting named..."
16 echo "exec $(which named) -g \"${EXTRA_ARGS}\""20 echo "exec $(which named) -u \"${BIND9_USER}\" -g \"${EXTRA_ARGS}\""
17 exec $(command -v named) -u bind -g ${EXTRA_ARGS}21 exec $(command -v named) -u "${BIND9_USER}" -g ${EXTRA_ARGS}
18else22else
19 exec "${@}"23 exec "${@}"
20fi24fi

Subscribers

People subscribed via source and target branches