On 2024-10-07 10:31, Thomas Goirand wrote:
During upgrades from one Debian suite to another, dpkg is prompting for
changes to /etc/haproxy/haproxy.cfg. This is very annoying and useless,
as there's no way someone will keep haproxy.cfg pristine unchanged for a
normal workload. Everyone is going to change that file to handle some kind
of workload, and therefore, everyone will be prompted.
The solution could be to have the sample haproxy.cfg stored somewhere else,
like for example /usr/share/haproxy/haproxy.cfg, and have something like this
in the postinst:
if [ ${1} = "configure" ] ; then
if ! [ -e /etc/haproxy/haproxy.cfg ] ; then
cp /usr/share/haproxy/haproxy.cfg /etc/haproxy
fi
fi
This way, only new installations would get the example file, and it wouldn't
be annoying to upgrade.
I don't know if such a pattern is widely applied. If there is a
packaging change (for syslog, for reload) that requires a configuration
change, this is the easiest way to communicate the information to the user.