On Mon, 2025-09-15 at 17:57 +0200, Marc Haber wrote:
> On Mon, Sep 15, 2025 at 02:57:01PM +0000, laurent wrote:
> > This time I looked a bit more in detail debian/isc-dhcp-relay.postinst does
> > :
> >
> > db_get isc-dhcp-relay/options || true
> > OPTIONS="${RET}"
> >
> > TMPFILE=`mktemp -q /tmp/dhcp.config.XXXXXX`
> > sed -e "s/^[[:space:]]*OPTIONS[[:space:]]*=.*/OPTIONS=\"${OPTIONS}\"/" \
> > <${INITCONFFILE} >${TMPFILE}
> > cp ${TMPFILE} ${INITCONFFILE}
> > rm ${TMPFILE}
> >
> > So this unconditionnally overwrite from db_get to
> > /etc/default/isc-dhcp-relay without telling the user.
>
> It reads the information from /etc/default/isc-dhcp-relay in
> debian/isc-dhcp-relay.config and puts in the database. It then prompts
> the user (presenting the values read in from the defaults file), and
> then the postinst pokes the potentially changed values back into the
> defaults file.
Hi,
Thanks for your quick answer and detailed explanation of the inner
working of debconf.
I read the .config script you mentionned and probably found the bug:
# Read current configuration - the user might not use dpkg-reconfigure
# to change /etc/default/isc-dhcp-relay, so we need to do this to
# preserve the configuration.
if [ -r ${INITCONFFILE} ]; then
. ${INITCONFFILE}
db_set isc-dhcp-relay/servers "${SERVERS}"
db_set isc-dhcp-relay/interfaces "${INTERFACES}"
fi
isc-dhcp-relay/options is not read at all from the config file so it
probably won't be checked and preserved.
>
> Barring bugs, this looks like proper handling of debconf-configured
> parameters. Please investigate why this does not work as advertised.
>
> That being said, please migrate away from isc-dhcp-relay; Debian 13 is
> likely the last debian release to feature that package. It has been dead
> upstream already for years.
Yes we're aware of this, we have a few thing to cleanup from our legacy
configs to be able to migrate off old ISC stuff.
>
> Greetings
> Marc
Thanks again for your help,
Sincerely,
Laurent