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
1diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
2index 4c8d14d..d04bfee 100755
3--- a/docker-entrypoint.sh
4+++ b/docker-entrypoint.sh
5@@ -10,11 +10,15 @@ elif [[ "${1}" == "named" || "${1}" == "$(command -v named)" ]]; then
6 set --
7 fi
8
9+# The user which will start the named process. If not specified,
10+# defaults to 'bind'.
11+BIND9_USER="${BIND9_USER:-bind}"
12+
13 # default behaviour is to launch named
14 if [[ -z "${1}" ]]; then
15 echo "Starting named..."
16- echo "exec $(which named) -g \"${EXTRA_ARGS}\""
17- exec $(command -v named) -u bind -g ${EXTRA_ARGS}
18+ echo "exec $(which named) -u \"${BIND9_USER}\" -g \"${EXTRA_ARGS}\""
19+ exec $(command -v named) -u "${BIND9_USER}" -g ${EXTRA_ARGS}
20 else
21 exec "${@}"
22 fi

Subscribers

People subscribed via source and target branches