#1084271 Please have /etc/haproxy/haproxy.cfg not owned by package

Package:
haproxy
Source:
haproxy
Description:
fast and reliable load balancing reverse proxy
Submitter:
Thomas Goirand
Date:
2024-10-07 16:51:01 UTC
Severity:
normal
#1084271#5
Date:
2024-10-07 08:31:34 UTC
From:
To:
Hi,

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.

Cheers,

Thomas Goirand (zigo)

#1084271#12
Date:
2024-10-07 16:48:41 UTC
From:
To:
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.