Code review comment for ~athos-ribeiro/ubuntu-docker-images/+git/bind9:foreground-flag

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

On Friday, October 07 2022, Athos Ribeiro wrote:

> On a second thought, I believe we should avoid trying to predict different use cases for our images (by bloating entrypoint scripts).

That's another way to look at this problem, indeed :-). When we started
the project, we were experimenting with different ways to tackle this
problem and I liked how the redis image turned out, but you certainly
have more hands-on experience with what's expected from OCI images in
general.

> Instead, users should overwrite entrypoints or commands to accommodate for specific use cases. This way, we could focus on having lean entrypoints that would start services with, if not the default, the most common use case for a component (when possible). This seems to be coherent with the distro practices on how systemd services are crafted and configured.
>
> Still, I agree this specific use case is common enough and the bug reporter request is indeed fair, and simple enough for us to include the requested option.
>
> Upstream's bin/named/server.c contains the following function:
>
> if (named_g_logstderr) {
> const cfg_obj_t *logobj = NULL;
>
> isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
> NAMED_LOGMODULE_SERVER, ISC_LOG_INFO,
> "not using config file logging "
> "statement for logging due to "
> "-g option");
>
> Moreover, by reading bin/named/logconf.c (channel_fromconf) we can also infer that, in the config file, users must pick one (and only one) of "a file", "stderr", "syslog", or "null" (meaning they can still chose to log to stderr from there).
>
> Therefore, a good name for the variable could be USE_CONFIG_FILE_LOGGING. This variable would have the opposite semantics of what was suggested, so it will be unset, and if it contains any value (test -n), then we will use the "-f" option to read user set logging configuration (just like the redis example you mentioned).
>
> For instance, running `podman run -e USE_CONFIG_FILE_LOGGING=1 -v $CUSTOM_CONF:/etc/named.conf docker.io/ubuntu/bind9:latest` would force named to read the logging params from $CUSTOM_CONF, if any.
>
> Thoughts?

I like it. Thanks for doing a deeper analysis of the problem. +1 from
my side.

Cheers,

--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14

« Back to merge proposal